/* Custom Sidebar Styles */
.custom-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(135deg, #227544 0%, #31372B 100%);
    color: white;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.custom-sidebar.collapsed {
    width: 70px;
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
    transition: all 0.3s ease;
}

.custom-sidebar.collapsed .logo {
    transform: scale(0.8);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Navigation Menu */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 5px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.nav-item.active .nav-link {
    background: rgba(255, 255, 255, 0.2);
    border-left: 4px solid #fff;
}

.nav-icon {
    width: 20px;
    margin-right: 15px;
    text-align: center;
    font-size: 18px;
}

.nav-text {
    flex: 1;
    font-weight: 500;
    transition: all 0.3s ease;
}

.custom-sidebar.collapsed .nav-text {
    opacity: 0;
    transform: translateX(-20px);
}

.submenu-arrow {
    font-size: 14px;
    transition: all 0.3s ease;
}

.nav-item.active .submenu-arrow {
    transform: rotate(90deg);
}

/* Submenu */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.1);
}

.submenu.expanded {
    max-height: 300px;
}

.submenu-item {
    margin: 0;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 55px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.submenu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

.submenu-item.active .submenu-link {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left: 3px solid #fff;
}

.submenu-text {
    flex: 1;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.user-avatar {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 16px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}

.user-role {
    font-size: 12px;
    opacity: 0.8;
    line-height: 1.2;
}

.custom-sidebar.collapsed .user-details {
    opacity: 0;
    transform: translateX(-20px);
}

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 8px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 18px;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Mobile Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Content Adjustment */
.layout-container {
    margin-left: 280px;
    transition: all 0.3s ease;
}

.layout-container.sidebar-collapsed {
    margin-left: 70px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    display: none;
}

.mobile-menu-toggle {
    background: linear-gradient(135deg, #227544 0%, #31372B 100%);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-sidebar {
        transform: translateX(-100%);
    }

    .custom-sidebar.mobile-open {
        transform: translateX(0);
    }

    .layout-container {
        margin-left: 0;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-toggle-container {
        display: block;
    }
}

/* Scrollbar Styling */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
