/* ===================================
   HEADER & NAVIGATION STYLES
   Modern Left Sidebar with Icons
   =================================== */

/* Header Container */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.875rem 1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Header Left - Hamburger + Logo grouped together */
.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

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

.logo {
    height: 36px;
    width: auto;
    display: block;
    transition: opacity 0.3s ease;
}

/* Light theme - show light logo, hide dark logo */
[data-theme="light"] .logo-light {
    display: block;
}

[data-theme="light"] .logo-dark {
    display: none;
}

/* Dark theme - hide light logo, show dark logo with inversion */
[data-theme="dark"] .logo-light {
    display: none;
}

[data-theme="dark"] .logo-dark {
    display: block;
    filter: brightness(0) saturate(100%) invert(98%) sepia(7%) saturate(552%) hue-rotate(186deg) brightness(116%) contrast(96%);
}

/* Header Actions (Right Side) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    font-size: 1.125rem;
}

.theme-toggle-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.theme-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hamburger Menu (Left Side) */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1001;
}

.hamburger:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.hamburger span {
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===================================
   LEFT SIDEBAR MENU
   =================================== */

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

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

/* Sidebar */
.sidebar-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 320px;
    max-width: 85vw;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1101;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-menu.active {
    transform: translateX(0);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.sidebar-logo {
    flex: 1;
}

/* Logo styling inherited from .logo class in styles.css for dark/light mode support */

.sidebar-close {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.sidebar-close:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

/* Sidebar Content */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
}

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

.sidebar-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Sidebar Section */
.sidebar-section {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    margin-bottom: 0.25rem;
}

/* Sidebar Item */
.sidebar-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    margin: 0.125rem 0;
}

.sidebar-item:hover {
    background: var(--bg-tertiary);
    border-left-color: var(--accent-primary);
}

.sidebar-item:active {
    transform: scale(0.98);
}

/* Sidebar Item Icon */
.sidebar-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    margin-top: 2px;
}

.sidebar-item:hover .sidebar-item-icon {
    color: var(--accent-primary);
    transform: scale(1.1);
}

.sidebar-item-icon svg {
    width: 100%;
    height: 100%;
}

/* Sidebar Item Content */
.sidebar-item-content {
    flex: 1;
    min-width: 0;
}

.sidebar-item-title {
    font-weight: 600;
    font-size: 0.938rem;
    margin-bottom: 0.125rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.sidebar-item-desc {
    font-size: 0.813rem;
    color: var(--text-secondary);
    line-height: 1.4;
    opacity: 0.85;
}

/* Active State */
.sidebar-item.active {
    background: linear-gradient(90deg, var(--bg-tertiary), transparent);
    border-left-color: var(--accent-primary);
}

.sidebar-item.active .sidebar-item-icon {
    color: var(--accent-primary);
}

.sidebar-item.active .sidebar-item-title {
    color: var(--accent-primary);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Desktop */
@media (min-width: 769px) {
    .header {
        padding: 0.875rem 1.5rem;
    }
    
    .logo {
        height: 40px;
    }
    
    .sidebar-menu {
        width: 340px;
    }
}

/* Tablet */
@media (max-width: 768px) {
    .sidebar-menu {
        width: 300px;
    }
    
    .sidebar-item {
        padding: 0.75rem 1rem;
    }
    
    .sidebar-section-title {
        padding: 0.5rem 1rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .header {
        padding: 0.75rem 0.875rem;
    }
    
    .logo {
        height: 32px;
    }
    
    .theme-toggle-btn,
    .hamburger {
        min-width: 2.25rem;
        height: 2.25rem;
    }
    
    .hamburger span {
        width: 16px;
    }
    
    .sidebar-menu {
        width: 280px;
        max-width: 90vw;
    }
    
    .sidebar-header {
        padding: 1rem 0.875rem;
    }
    
    .sidebar-logo img {
        height: 32px;
    }
    
    .sidebar-item {
        padding: 0.75rem 0.875rem;
        gap: 0.75rem;
    }
    
    .sidebar-section-title {
        padding: 0.5rem 0.875rem;
    }
    
    .sidebar-item-title {
        font-size: 0.875rem;
    }
    
    .sidebar-item-desc {
        font-size: 0.75rem;
    }
}

/* Small Mobile */
@media (max-width: 360px) {
    .sidebar-menu {
        width: 260px;
    }
    
    .sidebar-item-desc {
        display: none;
    }
}

/* Prevent body scroll when sidebar is open */
body.sidebar-open {
    overflow: hidden;
}

/* Animation keyframes */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
