/* ============================================================
   films.css — Styles propres à la page Films
   ============================================================ */

/* ============================================================
   FLUIDITÉ DES CARTES — surcharge des transitions de main.css
   ============================================================ */

/*
   On surcharge uniquement les durées/courbes ; la logique de
   layout (width, height, position) reste dans main.css.
   Les propriétés will-change préviennent les repaints coûteux
   en promouvant chaque carte sur son propre layer GPU.
*/
.movie-card {
    will-change: transform, width, height;
    transition:
        width       0.45s cubic-bezier(0.22, 1, 0.36, 1),
        height      0.45s cubic-bezier(0.22, 1, 0.36, 1),
        transform   0.45s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow  0.45s ease;
}

/* Backdrop ↔ poster : fondu plus lent et plus doux */
.movie-poster,
.movie-backdrop {
    transition: opacity 0.42s ease;
}

/* Overlay boutons : apparition légèrement différée */
.movie-hover-overlay {
    transition: opacity 0.3s ease 0.06s;
}

/* Infos sous la carte : glissement adouci */
.movie-info {
    transition: opacity 0.35s ease 0.08s, transform 0.35s ease 0.08s;
}

/* Boutons watchlist / info : rebond léger */
.movie-icon-btn {
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.22s ease,
                background 0.2s ease;
}
.movie-icon-btn:hover {
    transform: scale(1.15);
}
.nav-links a.nav-active {
    color: var(--accent-bright) !important;
}
.nav-links a.nav-active::after {
    width: 100% !important;
}

/* ============================================================
   CARROUSEL GENRES
   ============================================================ */
.genre-row {
    gap: 14px;
    padding: 16px 4px 50px;
}

.genre-card {
    position: relative;
    flex-shrink: 0;
    width: 210px;
    height: 125px;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    background: #1c1c1c;
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1),
                box-shadow 0.32s ease;
}
.genre-card:hover {
    transform: scale(1.07) translateY(-6px);
    box-shadow: 0 18px 52px rgba(0,0,0,0.75);
}

.genre-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.52) saturate(1.15);
    transition: transform 0.5s ease, filter 0.38s ease;
}
.genre-card:hover .genre-card-bg {
    transform: scale(1.1);
    filter: brightness(0.38) saturate(1.4);
}

.genre-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.05) 55%, rgba(0,0,0,0.5) 100%);
    transition: background 0.32s ease;
}
.genre-card:hover .genre-card-overlay {
    background: linear-gradient(135deg, rgba(229,9,20,0.28) 0%, rgba(0,0,0,0.05) 55%, rgba(0,0,0,0.55) 100%);
}

.genre-card-label {
    position: absolute;
    bottom: 13px;
    left: 15px;
    right: 10px;
    font-family: 'Bebas Neue', cursive;
    font-size: 21px;
    letter-spacing: 1.8px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.95);
    z-index: 2;
    transition: letter-spacing 0.3s ease;
}
.genre-card:hover .genre-card-label { letter-spacing: 2.8px; }

.genre-card-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-bright);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.34s ease;
    z-index: 3;
}
.genre-card:hover .genre-card-bar { transform: scaleX(1); }

/* ============================================================
   TOP 10 — STYLE NETFLIX (numéros géants, outline)
   ============================================================ */

/* Titre section — même police/taille que .category-title */
.top10-title-label {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
/* "Tendances du moment" — identique au reste du titre */
.top10-subtitle {
    font-family: 'Bebas Neue', cursive;
    font-size: 32px;          /* même taille que .category-title */
    letter-spacing: 2px;      /* même letter-spacing */
    color: rgba(255,255,255,0.55); /* légèrement atténué pour créer la séparation visuelle */
    font-weight: 400;
}

/* Rangée carrousel —
   NE PAS toucher overflow-x : main.css le pose à auto (scrollable).
   On garde overflow-y: visible pour que les grands numéros ne soient pas
   coupés verticalement, et on ajoute un padding-left pour le dépassement
   du #1. */
.top10-row {
    gap: 0;
    padding: 20px 4px 80px 30px;
    align-items: flex-end;
    overflow-y: visible;
    /* overflow-x: auto est hérité de .carousel-row → flèches fonctionnelles */
}

/* Wrapper item = numéro géant + carte */
.top10-item {
    position: relative;
    display: flex;
    align-items: flex-end;
    flex-shrink: 0;
    cursor: pointer;
}

/* ── Numéro géant style Netflix ── */
.top10-rank-num {
    /* Variables injectées en ligne par JS */
    --stroke: var(--accent-bright);
    --shadow: rgba(229,9,20,0.35);
    --glow:   #ff3030;

    font-family: 'Bebas Neue', cursive;
    font-size: 165px;
    line-height: 0.85;
    letter-spacing: -4px;

    /* Hollow outline */
    color: transparent;
    -webkit-text-stroke: 2.5px var(--stroke);
    text-stroke: 2.5px var(--stroke);

    /* Positionnement */
    flex-shrink: 0;
    width: 88px;           /* Espace alloué pour le numéro */
    text-align: right;     /* Aligne à droite pour que le chiffre colle au bord */
    overflow: visible;     /* Autorise le débordement pour "10" */
    align-self: flex-end;
    margin-right: -22px;   /* Overlap : la carte chevauche 22px sur le numéro */
    z-index: 0;

    pointer-events: none;
    user-select: none;

    /* Ombre portée subtile */
    filter: drop-shadow(0 4px 12px var(--shadow));

    transition: filter 0.3s ease, -webkit-text-stroke 0.3s ease;
}

/* La carte passe devant le numéro */
.top10-item .movie-card {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* Hover : la carte se soulève, le numéro brille */
.top10-item:hover .top10-rank-num {
    filter: drop-shadow(0 0 18px var(--glow)) drop-shadow(0 4px 16px var(--shadow));
    -webkit-text-stroke-width: 2px; /* légèrement plus fin = plus lumineux */
}
.top10-item:hover .movie-card {
    transform: scale(1.04) translateY(-6px);
    box-shadow: 0 20px 55px rgba(0,0,0,0.8);
    z-index: 2;
}

/* ── Rang 1 — Or ── */
.top10-item[data-rank="1"] .top10-rank-num {
    font-size: 185px;      /* Plus grand pour le #1 */
    width: 95px;
    --stroke: #FFD700;
    --shadow: rgba(255,215,0,0.6);
    --glow:   #ffe14d;
}

/* ── Rang 2 — Argent ── */
.top10-item[data-rank="2"] .top10-rank-num {
    font-size: 175px;
    width: 91px;
    --stroke: #C8C8C8;
    --shadow: rgba(200,200,200,0.45);
    --glow:   #e0e0e0;
}

/* ── Rang 3 — Bronze ── */
.top10-item[data-rank="3"] .top10-rank-num {
    font-size: 170px;
    width: 90px;
    --stroke: #CD7F32;
    --shadow: rgba(205,127,50,0.5);
    --glow:   #e6963d;
}

/* ── Rang 4-10 — Rouge accent (défaut) ── */
/* les variables inline de JS prennent effet directement */

/* ── Rang 10 — légèrement plus petit pour tenir ── */
.top10-item[data-rank="10"] .top10-rank-num {
    font-size: 130px;
    width: 130px;
    letter-spacing: -2px;
    margin-right: -28px;
}

/* ── Animation subtile d'apparition ── */
.top10-item {
    animation: top10FadeIn 0.4s ease both;
}
.top10-item:nth-child(1)  { animation-delay: 0.05s; }
.top10-item:nth-child(2)  { animation-delay: 0.10s; }
.top10-item:nth-child(3)  { animation-delay: 0.15s; }
.top10-item:nth-child(4)  { animation-delay: 0.20s; }
.top10-item:nth-child(5)  { animation-delay: 0.25s; }
.top10-item:nth-child(6)  { animation-delay: 0.30s; }
.top10-item:nth-child(7)  { animation-delay: 0.35s; }
.top10-item:nth-child(8)  { animation-delay: 0.40s; }
.top10-item:nth-child(9)  { animation-delay: 0.45s; }
.top10-item:nth-child(10) { animation-delay: 0.50s; }

@keyframes top10FadeIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .genre-card  { width: 160px; height: 100px; }
    .genre-card-label { font-size: 17px; }

    .top10-rank-num          { font-size: 110px; width: 60px; }
    .top10-item[data-rank="1"]  .top10-rank-num { font-size: 125px; width: 64px; }
    .top10-item[data-rank="2"]  .top10-rank-num { font-size: 118px; width: 62px; }
    .top10-item[data-rank="3"]  .top10-rank-num { font-size: 115px; width: 61px; }
    .top10-item[data-rank="10"] .top10-rank-num { font-size: 90px;  width: 90px; letter-spacing: -1px; }
}