/* ========================================
   Sidebar Navigation with Submenu
   ======================================== */

/* Sidebar Base Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .submenu-arrow,
.sidebar.collapsed .notification-badge {
    opacity: 0;
    width: 0;
    visibility: hidden;
}

.sidebar.collapsed .submenu {
    display: none !important;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
}

/* Sidebar Header */
.sidebar-header {
    padding: 25px 20px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.sidebar-brand i {
    font-size: 2rem;
    color: #3498db;
}

.sidebar-brand .brand-text {
    white-space: nowrap;
    transition: all 0.3s ease;
}

.sidebar-brand:hover {
    color: #3498db;
}

/* Sidebar Nav */
.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav .nav {
    gap: 5px;
}

/* Nav Item */
.nav-item {
    position: relative;
}

/* Nav Link */
.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-link i {
    font-size: 1.125rem;
    min-width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.nav-link .nav-text {
    white-space: nowrap;
    transition: all 0.3s ease;
	color: #fff;
    border-left-color: #3498db;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-left-color: #3498db;
}

.nav-link:hover i {
    transform: scale(1.1);
    color: #3498db;
}

.nav-link.active {
    background: rgba(52, 152, 219, 0.15);
    color: #fff;
    border-left-color: #3498db;
}

.nav-link.active i {
    color: #3498db;
}

/* Submenu Arrow */
.submenu-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-link.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

/* Submenu */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.15);
    list-style: none;
    padding: 0;
    margin: 0;
}

.submenu.open {
    max-height: 500px;
}

.submenu li {
    border-left: 3px solid transparent;
}

.submenu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px 12px 45px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.submenu-link i {
    font-size: 0.875rem;
    min-width: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.submenu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding-left: 50px;
    border-left-color: #3498db;
}

.submenu-link:hover i {
    color: #3498db;
    transform: translateX(3px);
}

.submenu-link.active {
    background: rgba(52, 152, 219, 0.2);
    color: #fff;
    border-left-color: #3498db;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Scrollbar Styles */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

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

/* Main Content Adjustment */
.main-content {
    margin-left: 280px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed ~ .main-content {
    margin-left: 80px;
}

/* Menu Toggle Button */
.menu-toggle {
    background: transparent;
    border: none;
    color: #2c3e50;
    font-size: 1.5rem;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.menu-toggle:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}

/* Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.submenu.open li {
    animation: slideDown 0.3s ease forwards;
}

.submenu.open li:nth-child(1) { animation-delay: 0.05s; }
.submenu.open li:nth-child(2) { animation-delay: 0.1s; }
.submenu.open li:nth-child(3) { animation-delay: 0.15s; }
.submenu.open li:nth-child(4) { animation-delay: 0.2s; }
.submenu.open li:nth-child(5) { animation-delay: 0.25s; }

/* Hover Effect */
.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #3498db;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-link:hover::before {
    transform: scaleY(1);
}

/* Active State Glow */
.nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: linear-gradient(180deg, #3498db, #2980b9);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
    border-radius: 0 2px 2px 0;
}
