/**
 * FlavaFlix Header 2026
 */

:root {
    --header-bg: #0a0a0a;
    --header-bg-glass: rgba(10, 10, 10, 0.95);
    --nav-bg: #111111;
    --accent-red: #e50914;
    --accent-red-hover: #f40d17;
    --accent-red-dark: #b20710;
    --text-white: #ffffff;
    --text-gray: #b3b3b3;
    --text-muted: #808080;
    --border-subtle: rgba(255, 255, 255, 0.1);
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ff-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.ff-header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
}

.ff-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 32px;
}

.ff-logo { flex-shrink: 0; }
.ff-logo a { display: block; text-decoration: none; }
.ff-logo img { height: 36px; width: auto; display: block; transition: transform var(--transition-fast); }
.ff-logo a:hover img { transform: scale(1.02); }

.ff-nav-primary {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: flex-start;
    margin-left: 40px;
}

.ff-nav-item { position: relative; }

.ff-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 6px;
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
}

.ff-nav-link:hover, .ff-nav-link.active { color: var(--text-white); background: rgba(255, 255, 255, 0.08); }
.ff-nav-link.active { color: var(--accent-red); }
.ff-nav-link .ff-icon-chevron { width: 12px; height: 12px; transition: transform var(--transition-fast); }
.ff-nav-item:hover .ff-icon-chevron { transform: rotate(180deg); }

.ff-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding: 8px 0;
    background: #1a1a1a;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-smooth);
}

.ff-nav-item:hover .ff-dropdown { opacity: 1; visibility: visible; transform: translateY(4px); }

.ff-dropdown-label {
    display: block;
    padding: 8px 20px 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ff-dropdown-link {
    display: block;
    padding: 10px 20px;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.ff-dropdown-link:hover { color: var(--text-white); background: rgba(255, 255, 255, 0.05); padding-left: 24px; }
.ff-dropdown-divider { height: 1px; background: var(--border-subtle); margin: 8px 16px; }

.ff-nav-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

.ff-search { position: relative; display: flex; align-items: center; }

.ff-search-container {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    overflow: hidden;
    width: 40px;
    transition: all var(--transition-smooth);
}

.ff-search-container.expanded { width: 300px; border-color: var(--accent-red); box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.15); }

.ff-search-input {
    flex: 1;
    width: 0;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-white);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-smooth);
}

.ff-search-container.expanded .ff-search-input { width: 100%; padding: 10px 16px 10px 0; }

.ff-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    flex-shrink: 0;
}

.ff-search-btn:hover { color: var(--text-white); }
.ff-search-btn svg { width: 18px; height: 18px; }

.ff-user-menu { position: relative; }

.ff-user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    color: var(--text-white);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ff-user-toggle:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }

.ff-user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-red-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.ff-user-name { font-size: 13px; font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-user-chevron { width: 14px; height: 14px; color: var(--text-muted); transition: transform var(--transition-fast); }
.ff-user-menu:hover .ff-user-chevron { transform: rotate(180deg); }

.ff-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    padding: 8px 0;
    margin-top: 8px;
    background: #1a1a1a;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-smooth);
}

.ff-user-menu:hover .ff-user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.ff-user-dropdown-header { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
.ff-user-dropdown-email { font-size: 12px; color: var(--text-muted); }
.ff-user-dropdown-points { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--accent-red); }

.ff-user-dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.ff-user-dropdown-link:hover { color: var(--text-white); background: rgba(255, 255, 255, 0.05); }
.ff-user-dropdown-link svg { width: 18px; height: 18px; opacity: 0.7; }
.ff-user-dropdown-link.logout { color: var(--accent-red); border-top: 1px solid var(--border-subtle); margin-top: 8px; }

.ff-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-red);
    border: none;
    border-radius: 6px;
    color: var(--text-white);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ff-login-btn:hover { background: var(--accent-red-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3); color: var(--text-white); }

.ff-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: var(--text-white);
    cursor: pointer;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.ff-mobile-toggle:hover { background: rgba(255, 255, 255, 0.08); }
.ff-mobile-toggle svg { width: 24px; height: 24px; }

/* Responsive Styles */
@media (max-width: 1024px) {
    .ff-nav-primary { gap: 2px; margin-left: 24px; }
    .ff-nav-link { padding: 8px 12px; font-size: 12px; }
    .ff-user-name { display: none; }
    .ff-user-toggle { padding: 6px; }
}

@media (max-width: 768px) {
    .ff-header-inner { padding: 0 16px; }
    .ff-nav-row { height: 60px; gap: 12px; }
    .ff-logo { order: 1; }
    .ff-nav-actions { order: 2; flex: 1; justify-content: flex-end; gap: 8px; }
    .ff-mobile-toggle { display: flex; order: 3; }

    .ff-nav-primary {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--header-bg);
        flex-direction: column;
        padding: 0;
        margin-left: 0;
        overflow-y: auto;
        z-index: 999;
        gap: 0;
        border-top: 1px solid var(--border-subtle);
    }

    .ff-nav-primary.mobile-open { display: flex; }
    .ff-nav-item { width: 100%; border-bottom: 1px solid var(--border-subtle); }
    .ff-nav-link { width: 100%; padding: 18px 20px; font-size: 15px; justify-content: space-between; border-radius: 0; background: transparent; }
    .ff-nav-link:hover, .ff-nav-link.active { background: rgba(255, 255, 255, 0.05); }
    .ff-nav-link .ff-icon-chevron { width: 16px; height: 16px; }

    .ff-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.4);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        min-width: 100%;
    }

    .ff-nav-item.mobile-dropdown-open .ff-dropdown { max-height: 600px; }
    .ff-dropdown-label { padding: 14px 20px 8px 28px; font-size: 11px; }
    .ff-dropdown-link { padding: 14px 20px 14px 28px; font-size: 14px; }
    .ff-dropdown-link:hover { padding-left: 32px; }
    .ff-dropdown-divider { margin: 8px 20px; }
    .ff-nav-item:hover .ff-icon-chevron { transform: none; }
    .ff-search-container.expanded { position: fixed; top: 70px; left: 16px; right: 16px; width: auto; border-radius: 8px; z-index: 1001; }
    .ff-login-btn { padding: 8px 14px; font-size: 12px; }
    .ff-login-btn svg { width: 16px; height: 16px; }
}

@media (max-width: 480px) {
    .ff-logo img { height: 28px; }
    .ff-nav-actions { gap: 6px; }
    .ff-search-btn { width: 36px; height: 36px; }
    .ff-search-container { width: 36px; }
    .ff-user-avatar { width: 32px; height: 32px; }
    .ff-login-btn span { display: none; }
    .ff-login-btn { padding: 10px; }
    .ff-mobile-toggle { width: 40px; height: 40px; }
}

/* Mobile-only nav items */
.ff-mobile-only { display: none; }
@media (max-width: 768px) {
    .ff-mobile-only { display: block; }
}
