/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, 
        rgba(26, 26, 46, 0.95) 0%, 
        rgba(22, 33, 62, 0.95) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12), 
                0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        rgba(26, 26, 46, 0.98) 0%, 
        rgba(22, 33, 62, 0.98) 100%
    );
    z-index: -1;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .search-header span,
.sidebar.collapsed .nav-divider span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-search {
    padding: 0.75rem;
}

.sidebar.collapsed .search-input-wrapper {
    display: none;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: white;
    white-space: nowrap;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    font-size: 0.9375rem;
    font-weight: 500;
    position: relative;
    cursor: pointer;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--color-primary);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.875rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.nav-item:hover::before {
    height: 70%;
}

.nav-item.active {
    background: linear-gradient(90deg, 
        rgba(0, 102, 204, 0.25) 0%, 
        rgba(0, 102, 204, 0.08) 100%
    );
    color: white;
    border-left-color: var(--color-primary);
    box-shadow: inset 0 0 20px rgba(0, 102, 204, 0.1);
}

.nav-item.active::before {
    height: 100%;
}

.sidebar.collapsed .nav-item.active {
    border-left: none;
    border-radius: 0.5rem;
    margin: 0.25rem 0.5rem;
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.9;
}

.nav-item span {
    transition: opacity 0.3s ease, width 0.3s ease;
    white-space: nowrap;
}

.nav-item.active svg {
    opacity: 1;
}

/* Sidebar Search */
.sidebar-search {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: padding 0.3s ease;
}

.sidebar.collapsed .sidebar-search {
    padding: 0.75rem;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
}

.sidebar.collapsed .search-header {
    justify-content: center;
    margin-bottom: 0;
}

.search-header svg {
    flex-shrink: 0;
}

.search-header span {
    transition: opacity 0.3s ease, width 0.3s ease;
    white-space: nowrap;
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
    transition: opacity 0.3s ease;
}

.search-input-wrapper input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.25),
                0 4px 12px rgba(0, 102, 204, 0.15);
    transform: translateY(-1px);
}

.search-btn {
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, 
        rgba(0, 102, 204, 0.9) 0%, 
        rgba(0, 82, 164, 0.9) 100%
    );
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.search-btn:hover {
    background: linear-gradient(135deg, 
        var(--color-primary) 0%, 
        rgba(0, 92, 184, 1) 100%
    );
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
    transform: translateY(-2px);
}

.search-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.3);
}

/* Nav Divider */
.nav-divider {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.5rem;
}

.sidebar.collapsed .nav-divider {
    padding: 0.5rem;
    text-align: center;
}

.nav-divider span {
    transition: opacity 0.3s ease, width 0.3s ease;
    white-space: nowrap;
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.9;
}

.nav-item.active svg {
    opacity: 1;
}

/* Main Wrapper */
.main-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-wrapper.sidebar-collapsed {
    margin-left: 70px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 999;
    background: linear-gradient(135deg, 
        var(--color-primary) 0%, 
        rgba(0, 82, 164, 1) 100%
    );
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 102, 204, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.mobile-menu-toggle:hover {
    background: linear-gradient(135deg, 
        var(--color-primary-hover) 0%, 
        rgba(0, 92, 184, 1) 100%
    );
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.15);
}

.mobile-menu-toggle:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .main-wrapper.sidebar-collapsed {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        max-width: 320px;
    }
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                backdrop-filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .sidebar-overlay {
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* Scrollbar styling for sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

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

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

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