/* ==========================================================================
   Header Styles - Unified across all pages
   ========================================================================== */

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --hover-bg: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --hover-bg: rgba(255, 255, 255, 0.05);
}

* { box-sizing: border-box; }

.site-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px var(--shadow-color);
    transition: background-color 0.3s, border-color 0.3s;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    margin: 0;
    padding: 0;
    height: 52px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0;
    height: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-right: 1px solid var(--border-color);
}

[data-theme="dark"] .brand {
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 50%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.03em;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

.logo:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #22d3ee 50%, #34d399 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.tagline {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 1rem;
    height: 100%;
}

.header-nav a {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.header-nav a:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.header-nav a.active {
    color: var(--primary);
    background: var(--hover-bg);
}

.header-nav a svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.header-nav a:hover svg,
.header-nav a.active svg {
    opacity: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-right: 1rem;
    height: 100%;
}

/* ==========================================================================
   Search (optional - only on pages with search)
   ========================================================================== */

.search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-form button {
    padding: 0.45rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.search-form button:hover {
    background: var(--primary-dark);
}

.search-input-wrapper {
    position: relative;
    width: 280px;
}

.search-input-wrapper input[type="text"] {
    width: 100%;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input-wrapper input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input-wrapper input[type="text"]::placeholder {
    color: var(--text-secondary);
}

/* ==========================================================================
   Dark Mode Toggle
   ========================================================================== */

.dark-mode-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 12px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.dark-mode-toggle:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
}

.dark-mode-toggle svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   Responsive - Mobile
   ========================================================================== */

@media (max-width: 768px) {
    .header-row {
        height: auto;
        flex-wrap: wrap;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
    }

    .brand {
        background: transparent;
        border-right: none;
        padding: 0;
    }

    [data-theme="dark"] .brand {
        background: transparent;
    }

    .tagline {
        display: none;
    }

    .header-nav {
        padding: 0;
        gap: 0.15rem;
    }

    .header-nav a {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .header-nav a svg {
        width: 12px;
        height: 12px;
    }

    .header-right {
        width: 100%;
        padding-right: 0;
        justify-content: space-between;
    }

    .search-input-wrapper {
        width: 100%;
        flex: 1;
    }

    .search-form {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .header-nav a span {
        display: none;
    }

    .header-nav a {
        padding: 0.4rem;
    }

    .header-nav a svg {
        width: 16px;
        height: 16px;
    }
}
