/* Modern Navigation Header Styles - Using Theme Variables */

.main-header {
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    margin: 0;
    font-size: 1.5rem;
}

.logo-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: var(--bg-surface-hover);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link svg {
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-menu {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-btn:hover {
    background: var(--bg-surface);
    border-color: var(--border-color);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chevron-down {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.profile-btn:hover .chevron-down {
    transform: translateY(2px);
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 280px;
    background: var(--bg-surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    overflow: hidden;
    z-index: 9999;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Ensure dropdown background is always opaque */
.profile-dropdown *,
.profile-dropdown .dropdown-header,
.profile-dropdown .dropdown-item,
.profile-dropdown .theme-toggle {
    background: inherit;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-surface-hover);
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.dropdown-user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.dropdown-user-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: none;
    text-align: left;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-surface-hover);
}

.dropdown-item svg {
    flex-shrink: 0;
}

.dropdown-item svg:not([fill="none"]) {
    /* Don't override gradient colors on filled SVGs */
}

.dropdown-item-danger {
    color: var(--error);
}

.dropdown-item-danger:hover {
    background: var(--error-light);
}

/* Wallet Item Styles */
.wallet-item {
    justify-content: space-between;
    background: transparent;
}

.wallet-item:hover {
    background: var(--bg-surface-hover);
}

.wallet-icon {
    color: #FFD700;
    flex-shrink: 0;
}

.coin-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-left: auto;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.coin-icon {
    color: #FFF8DC;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Test Cost Badge Styles */
.test-cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    padding: 0.25rem 0.625rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.test-cost-free {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.85rem;
    background: var(--success-light);
    color: var(--success);
}

.cost-coin-icon {
    color: #FFF8DC;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: none;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-surface-hover);
}

.theme-toggle svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .toggle-switch {
    background: var(--primary);
}

[data-theme="dark"] .toggle-switch::after {
    transform: translateX(20px);
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    background: var(--bg-surface);
}

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        padding: 0.75rem 1rem;
    }

    .tagline {
        display: none;
    }

    .header-center {
        display: none;
    }

    .user-name {
        display: none;
    }

    .profile-dropdown {
        min-width: 260px;
        right: -0.5rem;
    }
}

/* Override existing header styles for compatibility */
header.main-header ~ .container {
    min-height: calc(100vh - 180px);
}

/* Adjust spacing when new header is used */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body > *:not(.main-header):not(.main-footer) {
    flex: 1;
}
