/* --- HEADER & NAV --- */
header {
    background-color: rgba(22, 27, 34, 0.85);
    padding: 1rem 5%;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 50;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-left { display: flex; align-items: center; gap: 40px; }
.nav-right { display: flex; align-items: center; gap: 20px; }

.logo { 
    font-family: var(--font-display);
    font-size: 1.6rem; font-weight: 800; 
    color: var(--text-main); text-decoration: none; 
    letter-spacing: -0.5px; 
}
.logo span { color: var(--primary); }

.nav-links { display: flex; gap: 25px; align-items: center; }
.nav-links a { 
    color: var(--text-muted); text-decoration: none; font-weight: 600; 
    text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1.2px; 
    padding: 3px 0 5px; border-bottom: 2px solid transparent; transition: 0.3s; 
    font-family: var(--font-body);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    position: relative;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a.active { color: var(--text-main); border-bottom: 2px solid var(--primary); }

/* Suggestion nav special */
.nav-suggestion-link {
    background: linear-gradient(135deg, var(--primary), #c678dd) !important;
    color: #000 !important;
    border-radius: 30px !important;
    padding: 6px 14px !important;
    border-bottom: none !important;
    font-size: 0.78rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px;
    text-transform: uppercase; letter-spacing: 0.8px;
    transition: all 0.25s ease !important;
    box-shadow: 0 3px 12px rgba(255, 132, 161, 0.3);
    line-height: 1;
    vertical-align: middle;
}
.nav-suggestion-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 132, 161, 0.45) !important;
    color: #000 !important;
}
.nav-suggestion-link.active {
    border-bottom: none !important;
    color: #000 !important;
    opacity: 1;
    box-shadow: 0 4px 16px rgba(255, 132, 161, 0.5);
}

/* Amis nav */
.nav-friends-link {
    gap: 6px;
}

/* Badge notification */
.notif-badge {
    background: var(--primary);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    position: relative;
    top: -1px;
}

.search-container { position: relative; }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.9rem;}
.search-container input { 
    padding: 0.6rem 1rem 0.6rem 2.5rem; 
    border: 1px solid var(--border-color); border-radius: 30px; 
    background-color: var(--bg-color); color: var(--text-main); 
    outline: none; width: 220px; transition: all 0.3s ease; 
    font-size: 0.9rem; font-family: var(--font-body);
}
.search-container input:focus { 
    background-color: var(--surface); border-color: var(--primary); 
    box-shadow: var(--shadow-glow); width: 280px; 
}

/* ==========================================
   USER MENU / AVATAR HEADER
   ========================================== */
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px 6px 6px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    position: relative;
    transition: border-color 0.2s;
}
.user-menu:hover { border-color: var(--primary); }

.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #c678dd);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.85rem; color: #000;
    overflow: hidden;
    flex-shrink: 0;
}

.header-username {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 100;
    animation: dropdownFade 0.18s ease;
}
@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    border-bottom: none !important;
    border: none !important;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0;
    text-transform: none;
}
.user-dropdown a:hover { background: var(--primary-light); color: var(--primary); }
.user-dropdown a i { width: 16px; text-align: center; }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }
.dropdown-logout { color: #FC8181 !important; }
.dropdown-logout:hover { background: rgba(252, 129, 129, 0.1) !important; color: #FC8181 !important; }

/* ==========================================
   AUTH WALL
   ========================================== */
.auth-wall {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 2rem;
}

.auth-container {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: modalScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.auth-logo {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.3rem;
}
.auth-logo span { color: var(--primary); }

.auth-tagline {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.auth-tabs {
    display: flex;
    background: var(--bg-color);
    border-radius: 30px;
    padding: 4px;
    margin-bottom: 1.8rem;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 30px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.auth-tab.active {
    background: var(--surface);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-field label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.auth-field input,
.auth-field select {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 15px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}
.auth-field input:focus,
.auth-field select:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.auth-btn-primary {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-top: 4px;
    width: 100%;
}
.auth-btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.auth-btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    width: 100%;
}
.auth-btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.auth-error {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--primary-light);
    border: 1px solid rgba(255, 132, 161, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
}

.auth-success {
    color: #4ade80;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
}

/* ==========================================
   HERO BANNER
   ========================================== */
.hero-banner {
    position: relative;
    height: 580px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}
.hero-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    transform: scale(1.05);
    transition: transform 8s ease;
    filter: brightness(0.65);
}
.hero-banner:hover .hero-backdrop { transform: scale(1.0); }
.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(13,17,23,0.98) 0%, rgba(13,17,23,0.75) 50%, rgba(13,17,23,0.2) 100%),
                linear-gradient(to top, rgba(13,17,23,1) 0%, rgba(13,17,23,0.4) 40%, transparent 70%);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    padding: 3rem 5%;
    max-width: 600px;
    animation: heroFadeIn 0.8s ease forwards;
}
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero-badge {
    display: inline-block;
    background: var(--primary-light);
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
}
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.05;
    color: #fff;
    margin-bottom: 16px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.hero-synopsis {
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(230, 237, 243, 0.8);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 28px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    font-family: var(--font-body);
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
}
.hero-btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 4px 20px rgba(255, 132, 161, 0.4);
}
.hero-btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 132, 161, 0.5);
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
main { padding: 3rem 5%; max-width: 1400px; margin: 0 auto; }
.section-header { 
    display: flex; justify-content: space-between; align-items: flex-end; 
    margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); 
}
h2 { 
    color: var(--text-main); 
    font-size: 1.4rem; 
    font-weight: 700;
    font-family: var(--font-body);
}
.hidden { display: none !important; }
.filters-container select { 
    background-color: var(--surface); color: var(--text-main); 
    border: 1px solid var(--border-color); padding: 8px 15px; 
    border-radius: 20px; outline: none; font-size: 0.85rem; 
    font-weight: 500; cursor: pointer; font-family: var(--font-body);
}

/* ==========================================
   GRILLE & CARTES
   ========================================== */
.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 2rem; }

@keyframes cardFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.media-card { 
    background-color: var(--surface); border-radius: var(--radius-md); 
    position: relative; cursor: pointer; border: 1px solid transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; 
    box-shadow: var(--shadow-sm); overflow: hidden;
    opacity: 0;
    animation: cardFadeUp 0.5s ease forwards;
}
.media-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-glow); border-color: var(--primary); }
.media-poster { width: 100%; height: 240px; object-fit: cover; }
.media-info { padding: 1rem; text-align: center; }
.media-title { 
    color: var(--text-main); font-size: 0.9rem; font-weight: 700; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: var(--font-body);
}
.card-rating-label { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 4px; }
.card-stars { display: inline-flex; gap: 1px; }
.rl-star { font-size: 0.85rem; color: #4B5563; position: relative; display: inline-block; }
.rl-star.full { color: var(--star-color); }
.rl-star.half { 
    background: linear-gradient(to right, var(--star-color) 50%, #4B5563 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.card-rating-val { font-size: 0.78rem; font-weight: 700; color: var(--star-color); }

.card-badges { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 5px; }
.badge-icon { background: rgba(0,0,0,0.8); border: 1px solid var(--border-color); color: var(--star-color); padding: 4px 8px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; }
.badge-eye { color: var(--text-main); }
.badge-heart { color: var(--primary); }

/* ==========================================
   CATÉGORIES scroll horizontal
   ========================================== */
.category-section { margin-top: 3.5rem; }
.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}
.category-header h2 { flex: 1; }
.cat-scroll-btn {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 34px; height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.cat-scroll-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.category-row {
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    padding-bottom: 0.8rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
.category-row::-webkit-scrollbar { height: 5px; }
.category-row::-webkit-scrollbar-track { background: transparent; }
.category-row::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
.cat-card { flex: 0 0 150px; min-width: 150px; }
.cat-card .media-poster { height: 220px; }

/* Skeleton */
.skeleton { cursor: default; }
.skeleton:hover { transform: none; border-color: transparent; box-shadow: var(--shadow-sm); }
.skeleton-poster {
    width: 100%; height: 220px;
    background: linear-gradient(90deg, var(--surface) 25%, #1f2733 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================
   EMPTY STATES
   ========================================== */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
    animation: cardFadeUp 0.5s ease forwards;
    opacity: 0;
}
.empty-state-icon {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: var(--primary-light);
    border: 1px solid rgba(255, 132, 161, 0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    animation: emptyPulse 3s ease-in-out infinite;
}
@keyframes emptyPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 132, 161, 0.2); }
    50% { transform: scale(1.04); box-shadow: 0 0 0 12px rgba(255, 132, 161, 0); }
}
.empty-state-title {
    font-family: var(--font-display);
    font-size: 1.6rem; font-weight: 700; color: var(--text-main);
    margin-bottom: 0.6rem;
}
.empty-state-subtitle {
    font-size: 0.95rem; color: var(--text-muted); line-height: 1.6;
    max-width: 360px; margin-bottom: 2rem;
}
.empty-state-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--primary); color: #000; border: none;
    padding: 12px 28px; border-radius: 50px;
    font-weight: 700; font-size: 0.9rem; cursor: pointer;
    font-family: var(--font-body); transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(255, 132, 161, 0.3);
}
.empty-state-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }

