/* Sidebar */
/* Sidebar styles */
.fancy-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 240px;
    background: #23272b;
    color: #fff;
    z-index: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.2s;
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
}
.fancy-sidebar .sidebar-header {
    padding: 1.5rem 1.25rem 1rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 1px;
    border-bottom: 1px solid #343a40;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.fancy-sidebar .nav {
    flex: 1 1 auto;
    padding: 1rem 0.5rem;
}
.fancy-sidebar .nav-link {
    color: #adb5bd;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    font-size: 1.05rem;
    transition: background 0.15s, color 0.15s;
}
.fancy-sidebar .nav-link i {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}
.fancy-sidebar .nav-link.active, .fancy-sidebar .nav-link:hover {
    background: #495057;
    color: #fff;
}
.fancy-sidebar .sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #343a40;
    font-size: 0.95rem;
    color: #868e96;
}

/* Main content styles */
.fancy-main-content {
    margin-left: 240px;
    margin-top: 64px;
    padding: 2.5rem 2rem 2rem 2rem;
    transition: margin-left 0.2s;
}

/* Bottom bar styles for mobile */
.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 60px;
    background: #23272b;
    border-top: 1px solid #343a40;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1050;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.mobile-bottom-bar .nav {
    flex-wrap: nowrap !important;
}
.mobile-bottom-bar .nav-item {
    min-width: 0; /* Allow items to shrink */
    flex: 1 1 0; /* Equal width for all items */
    max-width: 25%; /* Prevent any item from being too wide */
}
.mobile-bottom-bar .nav-link {
    color: #adb5bd;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    padding: 0.25rem 0.25rem;
    border-radius: 0.375rem;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.mobile-bottom-bar .nav-link i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}
.mobile-bottom-bar .nav-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}
.mobile-bottom-bar .nav-link.active, .mobile-bottom-bar .nav-link:focus, .mobile-bottom-bar .nav-link:hover {
    background: #495057;
    color: #fff;
}

@media (max-width: 991.98px) {
    .fancy-sidebar {
        left: -240px;
        transition: left 0.2s;
    }
    .fancy-sidebar.show {
        left: 0;
    }
    .fancy-main-content {
        margin-left: 0;
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: -1;
    }
    .sidebar-backdrop.show {
        display: block;
    }
    /* Hide sidebar toggle button on mobile */
    #sidebarToggleBtn {
        display: none !important;
    }
}
@media (min-width: 992px) {
    .mobile-bottom-bar {
        display: none !important;
    }
}

/* Mobile responsive styles */
@media (max-width: 575.98px) {
    .mobile-bottom-bar .nav-link {
        font-size: 0.7rem;
        padding: 0.2rem 0.15rem;
    }
    .mobile-bottom-bar .nav-link i {
        font-size: 1.1rem;
    }
}

@media (max-width: 479.98px) {
    .mobile-bottom-bar .nav-link {
        font-size: 0.65rem;
        padding: 0.15rem 0.1rem;
    }
    .mobile-bottom-bar .nav-link i {
        font-size: 1rem;
    }
}

/* For very small screens, show only icons */
@media (max-width: 359.98px) {
    .mobile-bottom-bar .nav-link span {
        display: none;
    }
    .mobile-bottom-bar .nav-link i {
        font-size: 1.1rem;
        margin-bottom: 0;
    }
    .mobile-bottom-bar .nav-link {
        padding: 0.3rem 0.15rem;
    }
}

/* Chevron icon for collapsed/expanded state */
.fancy-sidebar .nav-link[aria-expanded]::after {
    content: "\f078"; /* FontAwesome chevron-down */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: 0.5rem;
    transition: transform 0.2s;
    display: inline-block;
}
.fancy-sidebar .nav-link[aria-expanded="true"]::after {
    content: "\f077"; /* FontAwesome chevron-up */
    /* Alternatively, you can rotate the chevron-down: */
    /* transform: rotate(180deg); */
}

.fancy-sidebar .collapsing {
    transition: height 0.1s;
}

.fancy-sidebar ul.nav.collapsing {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
}

/* Make the nav area scrollable if content overflows (desktop) */
.fancy-sidebar nav.flex-grow-1 {
    overflow-y: auto;
    flex-grow: 1;
    overflow-x: hidden;
    /* Optional: Add a nice scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #888 #23272b;
}

/* Optional: For Webkit browsers (Chrome, Edge, Safari) */
.fancy-sidebar nav.flex-grow-1::-webkit-scrollbar {
    width: 8px;
}
.fancy-sidebar nav.flex-grow-1::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}
.fancy-sidebar nav.flex-grow-1::-webkit-scrollbar-track {
    background: #23272b;
}
/* Sidebar End */