/* Header - Stays permanently dark across all themes */
header {
    background: rgba(9, 9, 11, 0.88) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    padding: 2rem 0;
    min-height: 95px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    isolation: isolate;
}

.header-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo span {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo:hover {
    transform: scale(1.03);
}

nav {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

nav ul.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.header-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: transparent;
}

.header-nav-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.header-nav-btn svg {
    opacity: 0.75;
    transition: all 0.2s ease;
}

.header-nav-btn:hover svg {
    opacity: 1;
    transform: scale(1.1);
}

.search-bar {
    flex: 1;
    max-width: 320px;
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.7rem 2.8rem 0.7rem 1.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 25px;
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

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

.search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(243, 156, 18, 0.6);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.15);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-btn:hover {
    color: #F39C12;
    background: rgba(255, 255, 255, 0.05);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.btn-donate {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.7rem 1.6rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
    transition: all 0.3s ease;
}

.btn-donate:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    filter: brightness(1.1);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1100;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.suggestion-item:hover {
    background: var(--bg-secondary);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    padding: 10px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
    font: inherit;
    color: inherit;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    z-index: 1100;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

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

.hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
    header {
        padding: 0.85rem 0;
        min-height: auto;
    }

    .hamburger {
        display: flex;
        order: 4;
    }

    .logo-section {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        position: relative;
        z-index: 2;
    }

    .header-actions {
        order: 2;
        z-index: 2;
        flex-shrink: 0;
    }

    .auth-buttons {
        order: 3;
        z-index: 2;
        flex-shrink: 0;
    }

    header nav,
    header .site-nav {
        display: none;
        width: 100%;
        order: 5;
        flex: 1 1 100%;
        position: relative;
        z-index: 1050;
        background: rgba(9, 9, 11, 0.96);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px;
        margin-top: 0.5rem;
        padding: 0.5rem;
        box-sizing: border-box;
    }

    header nav.active,
    header .site-nav.active {
        display: block;
    }

    header .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 0;
    }

    header .nav-links .header-nav-btn {
        width: 100%;
        padding: 0.85rem 1rem;
        min-height: 44px;
        box-sizing: border-box;
    }

    .header-container {
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 0.65rem;
    }

    .search-bar {
        order: 6;
        width: 100%;
        max-width: none;
        flex: 1 1 100%;
        position: relative;
        z-index: 1;
    }
}

body.nav-open {
    overflow: hidden;
}

/* Simple Profile Link */
.profile-link {
    display: inline-block;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    transition: all 0.3s ease;
}

.profile-link:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* Header profile avatar - must be 48px */
.auth-buttons .profile-avatar,
.profile-link .profile-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid #0f172a;
    transition: all 0.3s ease;
}

.profile-avatar-fallback {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid #0f172a;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.45);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.25);
}

.theme-icon {
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.theme-toggle-btn:hover .theme-icon {
    transform: rotate(20deg) scale(1.1);
}

/* In Dark mode: show Sun icon, hide Moon icon */
html:not([data-theme="light"]) .theme-toggle-btn .sun-icon {
    display: block;
    color: #fbbf24;
}
html:not([data-theme="light"]) .theme-toggle-btn .moon-icon {
    display: none;
}

/* In Light mode: show Moon icon, hide Sun icon */
[data-theme="light"] .theme-toggle-btn .sun-icon {
    display: none;
}
[data-theme="light"] .theme-toggle-btn .moon-icon {
    display: block;
    color: #818cf8;
}

/* Guarantee header navbar is 100% identical in both Light and Dark mode */
header,
[data-theme="light"] header {
    background: rgba(9, 9, 11, 0.88) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5) !important;
}

header .logo,
[data-theme="light"] header .logo {
    color: #ffffff !important;
}

header .header-nav-btn,
[data-theme="light"] header .header-nav-btn {
    color: rgba(255, 255, 255, 0.75) !important;
    background: transparent !important;
}

header .header-nav-btn:hover,
[data-theme="light"] header .header-nav-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

header .search-input,
[data-theme="light"] header .search-input {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

header .search-input::placeholder,
[data-theme="light"] header .search-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

header .search-btn,
[data-theme="light"] header .search-btn {
    color: rgba(255, 255, 255, 0.6) !important;
}

header .search-btn:hover,
[data-theme="light"] header .search-btn:hover {
    color: #F39C12 !important;
}

header .theme-toggle-btn,
[data-theme="light"] header .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

header .hamburger span,
[data-theme="light"] header .hamburger span {
    background: #ffffff !important;
}




