/* Resetting the default margin and padding */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Menghindari scrollbar di seluruh halaman */
}

/* Navbar styling */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px; /* Set the height of the navbar */
    background-color: #f8f9fa; /* Light background for the navbar */
    z-index: 1000; /* Ensure it stays above other elements */
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Optional shadow for better visibility */
}

/* Adjusting content margin to account for fixed navbar */
body {
    margin-top: 60px; /* Match this value with the navbar height */
}

/* Sidebar styling */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px; /* Align with navbar height */
    bottom: 0;
    height: 100%;
    width: 250px; /* Default width of the sidebar */
    padding: 15px;
    background-color: #f8f9fa;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 999;
    left: 0;
    transition: transform 0.5s ease;
    transform: translateX(-100%);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #dee2e6;
}

.sidebar.active {
    transform: translateX(0);
    z-index: 1001; /* Higher than the FAB when active */
}

/* Sidebar header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: #ffffff;
    z-index: 1000;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

/* Sidebar title */
.sidebar .sidebar-title {
    margin: 0; /* Menghapus margin default */
}

/* Sidebar Content */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

/* Sidebar Footer */
.sidebar-footer {
    background-color: #f8f9fa;
    padding-bottom: 3.5rem;
    text-align: center;
    font-size: 0.8rem; /* Ukuran font footer yang lebih kecil */
}

.sidebar-footer p {
    margin: 0;
}

/* Make the search bar sticky */
.sticky-search-bar {
    position: sticky;
    top: 0;
    background-color: #fff; /* Adjust background color if needed */
    z-index: 1000; /* Ensure it's above other content */
    padding-bottom: 10px;
}

/* Ensure the search bar remains above other content */
.sticky-search-bar .input-group {
    margin-bottom: 0; /* Remove margin to align with the sticky behavior */
}

.input-group-append {
    cursor: pointer;
}

/* Toggle button */
.toggle-button {
    background: none;
    border: none;
    color: #000000;
    font-size: 1.5rem;
    cursor: pointer;
}

.toggle-button:hover {
    transform: scale(1.1); /* Slightly enlarge on hover */
}

.toggle-button:focus {
    outline: none; /* Remove default focus outline */
}

/* List group inside the sidebar */
.sidebar .list-group {
    margin-bottom: 20px;
}

/* Responsive styles for sidebar */
@media (max-width: 992px) {
    .sidebar {
        width: 200px; /* Adjust width for smaller screens */
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 150px; /* Further adjust width for even smaller screens */
        padding: 5px;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 100%; /* Full width for very small screens */
        height: auto;
        top: 0; /* Reset top position for small screens */
        left: 0;
        transform: translateX(
            0
        ); /* Always show sidebar on very small screens */
    }
    .sidebar.active {
        transform: none;
    }
}

/* For very small screens or mobile devices */
@media (max-width: 480px) {
    .sidebar {
        position: relative; /* Make it relative to the document flow */
        width: 100%; /* Ensure it takes full width */
        height: auto; /* Auto height to fit content */
    }
}

/* Floating Action Button (FAB) */
#fab {
    position: absolute;
    top: 5rem;
    left: 1rem;
    z-index: 1000;
    color: white;
    transition: background-color 0.3s ease, transform 0.3s ease; /* Smooth transition for background-color and transform */
}

/* Responsive FAB size */
@media (max-width: 768px) {
    #fab {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    #fab {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
}

/* Map container styling */
#mapid {
    height: 100vh; /* Memastikan map mengisi seluruh tinggi viewport */
    width: 100vw; /* Memastikan map mengisi seluruh lebar viewport */
    z-index: 1;
}

/* Modal dialog max width and content height */
.modal-dialog {
    max-width: 65%;
}

.modal-content {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.carousel-inner img {
    width: 100%;
    height: auto;
}

.asset-item:hover {
    cursor: pointer;
    background-color: #343a40;
    color: white;
}

/* Sidebar content styling */
#asset-list {
    overflow-y: auto;
    flex: 1;
}
