/* ========================================
   Header & Navigation
   ======================================== */

header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: relative;
    z-index: 100;
    transition: background-color var(--transition), border-color var(--transition);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.tabs {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
}

h1 {
    flex: 0 0 auto;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle-btn {
    width: 48px;
    height: 26px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 13px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
}

.theme-toggle-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform var(--transition);
}

[data-theme="light"] .theme-toggle-btn::after {
    transform: translateX(22px);
}

.theme-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}



.docs-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all var(--transition);
}

.docs-link:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* PWA Install Button */
.pwa-install-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    background: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.pwa-install-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all var(--transition);
}

.auth-link:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* User Profile */
.user-profile {
    position: relative;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color var(--transition);
}

.profile-avatar:hover {
    border-color: var(--text-muted);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #444, #666);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 200px;
    box-shadow: 0 4px 20px var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-profile.open .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-info {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.profile-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.profile-dropdown hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.25rem 0;
}

.dropdown-item {
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}