/* ========================================
   Authentication Header & Navigation
   ======================================== */

/* Authentication Header */
.auth-header {
    background-color: var(--color-bg-secondary);
    border-bottom: 2px solid var(--color-border-primary);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.auth-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo a {
    color: var(--color-brand-primary);
    text-decoration: none;
    font-size: var(--text-heading);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    transition: color var(--transition-fast);
}

.logo a:hover {
    color: var(--color-brand-secondary);
}

/* ========================================
   Horizontal Navigation Menu
   ======================================== */

.header-nav-horizontal {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    max-width: 600px;
    margin: 0 2rem;
}

.header-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #e0e0e0;
    text-decoration: none;
    background: transparent;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-size: var(--text-body);
    white-space: nowrap;
    position: relative;
}

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

.header-nav-item .nav-icon {
    font-size: 1.1em;
}

.header-nav-item .nav-text {
    font-weight: var(--font-medium);
}

/* Favorites Count Badge */
.header-nav-item .favorites-count-badge {
    background: var(--color-accent-orange);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: var(--font-bold);
    line-height: 1;
    min-width: 20px;
    text-align: center;
}

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

.header-nav-dropdown {
    position: relative;
}

.header-nav-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.header-nav-dropdown-btn .dropdown-arrow {
    font-size: 0.7em;
    margin-left: 4px;
    transition: transform 0.2s;
}

.header-nav-dropdown-btn:hover .dropdown-arrow,
.header-nav-dropdown-btn.active .dropdown-arrow {
    transform: translateY(1px);
}

.header-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-secondary);
    border-radius: var(--radius-md);
    min-width: 240px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.2s;
    font-size: var(--text-body);
    white-space: nowrap;
}

.header-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-brand-primary);
}

.header-dropdown-item:first-child {
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.header-dropdown-item:last-child {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.header-dropdown-item .nav-icon {
    font-size: 1.1em;
}

/* Auth Menu Container */
.auth-menu {
    display: flex;
    align-items: center;
}

/* User Menu (when logged in) */
.user-menu {
    position: relative;
    display: inline-block;
}

/* Profile Trigger (clickable area) */
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-xl);
    transition: background-color var(--transition-fast);
}

.profile-trigger:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Profile Picture */
.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-brand-primary);
    object-fit: cover;
    background-color: var(--color-bg-tertiary);
    display: block;
}

/* Username Display */
.user-name {
    color: var(--color-text-secondary);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    line-height: var(--leading-tight);
}

/* Profile Dropdown */
.profile-dropdown {
    /* display: none; - Removed: Alpine.js x-show handles visibility */
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background-color: var(--color-bg-elevated);
    border: 1px solid var(--color-border-secondary);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    z-index: 1000;
}

.profile-dropdown.show {
    display: block;
}

/* Dropdown Items */
.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--text-body);
    border: none;
    background: none;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-item:first-child {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Dropdown Divider */
.dropdown-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 0.5rem 0;
}

/* Dropdown Item Variants */
.dropdown-item.btn-admin {
    color: var(--color-brand-primary);
    font-weight: 600;
}

.dropdown-item.btn-admin:hover {
    background-color: rgba(76, 175, 80, 0.2);
}

.dropdown-item.btn-delete-account {
    color: var(--color-error);
    font-weight: var(--font-medium);
}

.dropdown-item.btn-delete-account:hover {
    background-color: rgba(211, 47, 47, 0.1);
}

.admin-icon {
    margin-right: 0.5rem;
}

/* Responsive Header - Mobile */
@media (max-width: 768px) {
    .auth-container {
        padding: 0 20px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .logo a {
        font-size: var(--text-body);
    }

    .header-nav-horizontal {
        margin: 0 1rem;
        gap: 2px;
        max-width: none;
    }

    .header-nav-item {
        padding: 8px 12px;
        font-size: var(--text-small);
    }

    .header-nav-item .nav-text {
        display: none;
    }

    .header-nav-item .nav-icon {
        font-size: 1.3em;
    }

    .user-menu {
        gap: 0.75rem;
    }

    .user-name {
        display: none;
    }

    .profile-pic {
        width: 35px;
        height: 35px;
    }
}
