/* site.css */

/* General Reset and Base Styles */
* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* App Bar */
#defaultAppBar {
    z-index: 1000; /* Above sidebar */
    position: fixed;
    top: 0;
    width: 100%;
}

/* Sidebar */
#sidebar {
    z-index: 500; /* Below app bar */
    position: fixed;
    top: 55px; /* Match app bar height */
    height: calc(100vh - 55px);
    background-color: #fff;
    border-right: 1px dashed rgba(75,82,85,0.24);
    padding: 10px 20px;
    overflow: hidden;
    flex: 1 0 auto;
}

    #sidebar .e-menu-wrapper {
        width: 100%;
        background-color: inherit;
        overflow: visible; /* Prevent icon clipping */
    }

    /* Docked State (100px) */
    #sidebar.e-close {
        padding-left: 10px;
        padding-right: 10px;
    }

        #sidebar.e-close .app-logo,
        #sidebar.e-close .profile-wrapper .titles {
            display: none !important; /* Hide logo and titles */
        }

        #sidebar.e-close .e-menu-item .e-anchor-wrap {
            font-size: 0; /* Hide text */
        }

        #sidebar.e-close .e-menu-item .e-menu-icon {
            visibility: visible !important; /* Force icon visibility */
            font-size: 18px !important; /* Consistent icon size */
            margin: 0 auto; /* Center icons */
            display: block;
        }

    /* Expanded State (290px) */
    #sidebar.e-open .e-menu-item .e-anchor-wrap {
        font-size: 14px; /* Restore text */
    }

    #sidebar.e-open .e-menu-item .e-menu-icon {
        visibility: visible;
        margin-right: 10px; /* Space between icon and text */
    }

@media (max-width: 768px) {
    #sidebar {
        display: none !important;
    }

    .e-sidebar.e-open {
        display: block !important;
    }
}

/* Dashboard Container */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main Content */
.main-content {
    flex: 1 0 auto;
    padding: 20px;
    margin-top: 55px; /* Match app bar height */
    margin-left: 100px; /* Default for docked sidebar */
    transition: margin-left 0.3s ease; /* Smooth transition */
}

#sidebar.e-open ~ .main-content {
    margin-left: 290px; /* Adjust for expanded sidebar */
}

/* Footer */
.footer {
    flex-shrink: 0;
    padding: 1rem 0;
    background-color: #f8f9fa;
    font-size: 0.9rem;
}

    .footer a {
        color: rgb(255, 193, 7);
        text-decoration: none;
    }

        .footer a:hover {
            text-decoration: underline;
        }

/* Navbar Enhancements */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background-color: rgba(18, 22, 29);
    margin-left: 290px; /* Align with expanded sidebar */
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

    .navbar-brand:hover {
        color: rgb(255, 193, 7);
    }

.nav-link {
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    background-color: #343a40;
    color: #fff;
}

.dropdown-item {
    color: #fff;
    padding: 0.5rem 1rem;
    transition: background-color 0.3s ease;
}

    .dropdown-item:hover {
        background-color: #495057;
        color: #fff;
    }

/* Navbar Icons */
nav.navbar i {
    padding: 10px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

    nav.navbar i:hover,
    nav.navbar img:hover {
        background-color: #48545f14;
        transform: scale(1.05) translateZ(0px);
    }

/* Menu */
#menu {
    width: 100% !important;
    background-color: inherit;
    overflow: visible;
}

    #menu .e-menu-item:not(.e-separator) {
        height: 50px;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center; /* Center in docked mode */
    }

    #menu .e-menu-item {
        box-sizing: border-box;
    }

        #menu .e-menu-item a {
            width: 100%;
            color: rgb(171, 163, 152);
            font-weight: 300;
            padding: 7px 5px;
            box-sizing: border-box;
            display: flex;
            align-items: center;
        }

        #menu .e-menu-item .e-menu-icon {
            color: rgb(171, 163, 152);
            font-size: 18px;
        }

        #menu .e-menu-item.e-separator {
            border: none;
            margin: 5px 5px;
            text-transform: uppercase;
            font-weight: bold;
            font-size: 13px;
            color: #65da41;
            text-align: center;
        }

            #menu .e-menu-item.e-separator:not(:first-child) {
                margin-top: 35px;
            }

/* Sidebar Toggler */
#sidebar-toggler {
    margin-top: auto;
    width: 100%;
    height: 50px;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    color: rgb(171, 163, 152);
    display: flex;
    align-items: center;
    justify-content: center;
}

    #sidebar-toggler:hover {
        background-color: #48545f14;
        transform: scale(1.05) translateZ(0px);
    }

#sidebar.e-close #sidebar-toggler-icon:before {
    content: '\f101'; /* Right arrow */
}

#sidebar.e-open #sidebar-toggler-icon:before {
    content: '\f100'; /* Left arrow */
}

/* Profile Pic */
img.profile-pic {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-dropdown {
    border: none;
    background: none;
    padding: 0;
}

/* Logo */
.logo-wrapper {
    height: 70px;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.app-logo {
    padding: 10px 10px;
}

/* Widget Styles */
.widget .accordion-item {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
}

.widget .accordion-button {
    font-weight: 500;
    background-color: #Fd7e14;
    color: #333;
    padding: 1rem;
    box-shadow: none;
}

    .widget .accordion-button:not(.collapsed) {
        background-color: #e9ecef;
        color: rgb(255, 193, 7);
    }

    .widget .accordion-button:focus {
        box-shadow: none;
        border-color: #ced4da;
    }

.widget .accordion-body {
    padding: 1.5rem;
    background-color: #fff;
}

    .widget .accordion-body ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

        .widget .accordion-body ul li {
            padding: 0.5rem 0;
            border-bottom: 1px solid #eee;
        }

            .widget .accordion-body ul li:last-child {
                border-bottom: none;
            }

/* User Profile Dropdown */
.navbar-nav .dropdown-toggle.text-light {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-menu-end {
    right: 0;
    left: auto;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .navbar-nav {
        padding: 1rem 0;
    }

    .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

        .nav-item:last-child {
            border-bottom: none;
        }

    .dropdown-menu {
        background-color: transparent;
        box-shadow: none;
        padding-left: 1rem;
    }

    .main-content {
        padding: 20px 15px;
        margin: 10px 0;
    }

    .widget .accordion-button {
        font-size: 0.95rem;
        padding: 0.75rem;
    }

    .widget .accordion-body {
        padding: 1rem;
    }

    .navbar {
        margin-left: 0; /* Reset for mobile */
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .footer {
        text-align: center;
        font-size: 0.85rem;
    }

    .widget .accordion-button {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    .widget .accordion-body {
        padding: 0.75rem;
    }
}

/* Utility Classes */
.container-fluid {
    max-width: 100%;
}

/* Hover Effects for Interactive Elements */
.btn-link {
    color: #fff;
    text-decoration: none;
}

    .btn-link:hover {
        color: rgb(255, 193, 7);
        text-decoration: underline;
    }

/* Dropdown Submenu */
.dropdown-submenu {
    position: relative;
}

    .dropdown-submenu .dropdown-menu {
        top: 0;
        left: 100%;
        margin-left: 0.1rem;
        display: none;
    }

    .dropdown-submenu:hover .dropdown-menu {
        display: block;
    }
