/**
 * Header User Profile Styles
 * Shared styles for user profile dropdown in landing and public headers
 */

/* User Profile Container (replaces auth buttons when logged in) */
.header-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tariff Badge */
.header-tariff-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary, #8B5CF6);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-tariff-badge:hover {
    background: rgba(139, 92, 246, 0.25);
    transform: translateY(-1px);
}

/* Tariff badge variants */
.header-tariff-badge[data-tariff="0"] {
    color: var(--text-secondary, #9CA3AF);
    background: rgba(156, 163, 175, 0.1);
    border-color: rgba(156, 163, 175, 0.2);
}

.header-tariff-badge[data-tariff="1"] {
    color: var(--info, #3B82F6);
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.header-tariff-badge[data-tariff="2"] {
    color: var(--primary, #8B5CF6);
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.header-tariff-badge[data-tariff="3"] {
    color: var(--success, #22C55E);
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

/* User Dropdown Container */
.header-user-dropdown {
    position: relative;
}

/* User Button */
.header-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-secondary, #1A1A1F);
    border: 1px solid var(--border-color, #2D2D35);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary, #FFFFFF);
    font-family: inherit;
    font-size: 0.9rem;
}

.header-user-btn:hover {
    background: var(--bg-tertiary, #252530);
    border-color: var(--border-hover, #3D3D45);
}

/* User Avatar */
.header-user-avatar {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary, #8B5CF6) 0%, var(--primary-dark, #6D28D9) 100%);
    border-radius: 50%;
    font-size: 14px;
}

/* User Name */
.header-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Arrow Icon */
.header-user-arrow {
    font-size: 8px;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.header-user-dropdown.open .header-user-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.header-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary, #1A1A1F);
    border: 1px solid var(--border-color, #2D2D35);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

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

/* Dropdown Items */
.header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary, #9CA3AF);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    font-family: inherit;
}

.header-dropdown-item:hover {
    background: var(--bg-tertiary, #252530);
    color: var(--text-primary, #FFFFFF);
}

.header-dropdown-item .icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Dropdown Divider */
.header-dropdown-divider {
    height: 1px;
    background: var(--border-color, #2D2D35);
    margin: 8px 0;
}

/* Logout Button */
.header-dropdown-item.logout {
    color: var(--error, #EF4444);
}

.header-dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error, #EF4444);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .header-user-profile {
        gap: 8px;
    }

    .header-tariff-badge {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .header-tariff-badge .tariff-name {
        display: none;
    }

    .header-user-btn {
        padding: 4px 10px;
    }

    .header-user-name {
        display: none;
    }

    .header-dropdown-menu {
        min-width: 180px;
        right: -8px;
    }
}

/* Hide auth buttons when logged in */
.header-actions.logged-in .header-auth-buttons {
    display: none;
}

.header-actions.logged-in .header-user-profile {
    display: flex;
}

/* Show auth buttons when not logged in */
.header-actions:not(.logged-in) .header-auth-buttons {
    display: flex;
    gap: 12px;
}

.header-actions:not(.logged-in) .header-user-profile {
    display: none;
}