/* =============================================
   VARIABLES & BASE
   ============================================= */
:root {
    --netflix-red: #ffffff;
    --netflix-logo: #ffffff;
    --netflix-dark: #000000;
    --brand-red: #eaeaea;
}

html {
    font-size: 75%;
    overflow-x: hidden;
    scrollbar-width: none;
}
html::-webkit-scrollbar { display: none; }

body {
    background-color: var(--netflix-dark);
    margin: 0;
    padding: 0;
    padding-bottom: 100px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #ffffff;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-width: none;
    width: 100%;
    box-sizing: border-box;
}
body::-webkit-scrollbar { display: none; }

body::before { display: none !important; }


/* =============================================
   HEADER / BANNER
   ============================================= */
.site-banner {
    width: 100%;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: none !important;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 4%;
    position: fixed;
    top: 0;
    z-index: 1300;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.site-banner h1,
.site-banner i {
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
}

.main-content { margin-top: 0 !important; }

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 1400;
}

.logo-pulse {
    display: inline-block;
    color: #e50914 !important;
    text-decoration: none;
    font-weight: 900;
    animation: header-heartbeat 1.5s infinite ease-in-out;
    transform-origin: center;
}

@keyframes header-heartbeat {
    0%   { transform: scale(1); }
    15%  { transform: scale(1.08); }
    30%  { transform: scale(1); }
    45%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}


/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    width: 300px;
    position: fixed;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1200;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    left: -300px;
    top: 0;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 100px;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.menu-toggle:hover + .sidebar,
.sidebar:hover,
.sidebar.active {
    left: 0;
    pointer-events: auto;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}

.nav-item {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    text-align: left;
    padding: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: 0.3s;
    border-radius: 4px;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.1); }
.nav-item.active { border-left: 3px solid var(--netflix-red); background: rgba(255, 255, 255, 0.05); }

.nav-item.all-categories-trigger {
    color: #ffffff;
    font-weight: bold;
    border: 1px solid rgba(229, 9, 20, 0.2);
    margin-top: 5px;
}

.nav-item.all-categories-trigger:hover {
    background: rgba(229, 9, 20, 0.1);
    border-color: #e50914;
}

.nav-item.all-categories-trigger i { color: #e50914; }


/* =============================================
   SEARCH
   ============================================= */
.search-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    z-index: 2;
}

.search-bar-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 50px;
    width: 45px;
    height: 45px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-sizing: border-box;
}

.search-bar-container:hover,
.search-bar-container:focus-within {
    width: 350px;
    background: rgba(0, 0, 0, 0.9);
    border-color: #ffffff;
    padding: 10px 20px;
}

.search-bar-container i {
    font-size: 1.4rem;
    color: white;
    flex-shrink: 0;
    margin-left: 5px;
}

.search-bar-container input {
    background: none;
    border: none;
    color: white;
    outline: none;
    width: 100%;
    margin-left: 15px;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-bar-container:hover input,
.search-bar-container:focus-within input {
    opacity: 1;
}

#searchDropdown {
    display: none;
    position: absolute !important;
    top: 50px !important;
    left: 0 !important;
    width: 100% !important;
    background: #141414 !important;
    border: 1px solid #444 !important;
    z-index: 99999 !important;
    max-height: 400px;
    overflow-y: auto;
}

.search-dropdown {
    width: 600px !important;
    max-height: 450px !important;
    display: none;
    flex-direction: row;
    background: #141414 !important;
    border: 1px solid #333;
    border-radius: 8px;
}

.search-dropdown::-webkit-scrollbar { width: 6px; }
.search-dropdown::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }

.search-results-left {
    flex: 1;
    border-right: 1px solid #333;
    display: none;
    background: rgba(229, 9, 20, 0.05);
    padding: 10px 0;
}

.search-results-right {
    flex: 2;
    padding: 10px 0;
}

.search-section-title {
    padding: 5px 15px;
    font-size: 11px;
    color: #e50914;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 15px;
    cursor: pointer;
    border-bottom: 1px solid #222;
    transition: background 0.2s ease;
}

.search-item:hover { background: #222 !important; }

.search-item img {
    width: 80px;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 4px;
}

.search-item h4 {
    font-size: 0.9rem;
    color: white;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item.category-result {
    background: rgba(229, 9, 20, 0.1) !important;
    border-left: 4px solid #e50914 !important;
    padding: 12px;
    margin-bottom: 2px;
}

.search-item.category-result:hover { background: rgba(229, 9, 20, 0.2) !important; }

.cat-icon-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #e50914;
}

.cat-icon-wrapper i { font-size: 1.2rem; }

.cat-info { display: flex; flex-direction: column; }
.cat-info h4 { color: #fff; margin: 0; font-size: 1rem; }

.cat-tag {
    font-size: 10px;
    text-transform: uppercase;
    color: #e50914;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 2px;
}


/* =============================================
   HERO BANNER
   ============================================= */



/* =============================================
   CATEGORIES
   ============================================= */
.categories-bar {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding: 6px 4%;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    touch-action: pan-x;
}

.categories-bar.hidden-bar { display: none !important; }
.categories-bar::-webkit-scrollbar { display: none; }

.category-item {
    background: linear-gradient(45deg, #222, #333);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff !important;
    min-width: 200px;
    aspect-ratio: 16/9;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    transition: 0.4s ease-out;
    font-size: 0.96rem;
    text-transform: uppercase;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 8px rgba(0,0,0,0.95), 0 0 20px rgba(0,0,0,0.8);
    z-index: 1;
}
/* Ensure text stays on top of bg overlay */
.category-item > span,
.category-item > i,
.category-item > .cat-label {
    position: relative;
    z-index: 2;
}

.category-item:hover {
    background: white;
    color: black;
    transform: scale(1.1);
    z-index: 10;
}

.category-item.all-cats {
    background: linear-gradient(45deg, #222, #333);
    color: white;
    border-color: rgba(255,255,255,0.15);
}
.category-item.all-cats:hover {
    filter: brightness(1.1);
    color: #fff !important;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px 4%;
}

.categories-grid .category-item { min-width: unset; width: 100%; }


/* =============================================
   VIDEO ROWS & CARDS
   ============================================= */
.netflix-title {
    font-size: 2rem;
    color: #ffffff;
    margin-left: 0;
    margin-top: 30px;
    font-weight: 800;
    letter-spacing: 0px;
    text-transform: uppercase;
}

.netflix-row {
    display: flex;
    overflow-x: auto;
    overflow-y: visible;
    gap: 10px;
    padding: 20px 12px;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    touch-action: pan-x;
    /* Extra vertical padding so scale(1.08) doesn't get clipped */
    padding-bottom: 28px;
}

.netflix-row::-webkit-scrollbar { display: none; }
.netflix-row:active { cursor: grabbing; }

/* ── Netflix Card redesign ── */
.video-card {
    position: relative;
    min-width: 300px !important;
    max-width: 300px !important;
    cursor: pointer;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease;
    flex-shrink: 0;
    background: #111 !important;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
    overflow: visible !important;
}

.video-card:hover {
    transform: scale(1.07);
    z-index: 50;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.75), 0 0 0 1.5px rgba(255, 255, 255, 0.22);
}

.thumb-container {
    width: 100%;
    height: auto !important;
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
    border-radius: 9px 9px 0 0;
    background-color: #000 !important;
}

.main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.fav-btn {
    display: flex !important;
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid white;
    color: transparent;
    -webkit-text-stroke: 1px white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    z-index: 60;
    cursor: pointer;
}

.fav-btn.active { background: white; color: black; -webkit-text-stroke: 0px; }

.views-badge {
    position: absolute;
    bottom: 7px;
    right: 7px;
    background: rgba(0,0,0,0.75);
    color: #fff !important;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
}
.views-badge i { color: rgba(255,255,255,0.75); font-size: 9px; }

.progress-bar-netflix { position: absolute; bottom: 0; width: 100%; height: 3px; background: rgba(255,255,255,0.2); }
.progress-fill { height: 100%; background: var(--netflix-red); }


/* =============================================
   TOP 10
   ============================================= */

/*
 * Logique dimensionnelle :
 *   card-width  = 28vw  (clampé entre 180px et 520px)
 *   card-height = card-width * 9/16  = 28vw * 0.5625 = 15.75vw
 *   font-size du chiffre = card-height → chiffre aussi haut que la vidéo
 *   Sur mobile : card = 52vw → height = 29.25vw → font = 29.25vw
 */

/* ------ Variables locales Top10 ------ */
/* card-w = num-size × 16/9
   20vw × 16/9 = 35.56vw  → on arrondit à 35.5vw
   clamp séparés pour éviter calc(clamp()) non supporté */
:root {
    --t10-num-size: 6vw;
    --t10-card-w:   17vw;
}
@media (min-width: 1700px) {
    :root { --t10-num-size: 85px; --t10-card-w: 260px; }
}
@media (max-width: 700px) {
    :root { --t10-num-size: 42px; --t10-card-w: 130px; }
}

#secTop10 { margin-bottom: 0; }

/* Titre aligné avec le premier chiffre (même padding-left que la row) */
#secTop10 .netflix-title {
    font-size: 1.4rem !important;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
    margin-bottom: 0 !important;
    margin-top: 8px !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    line-height: 1 !important;
}

/* Row scrollable horizontale */
.top10-style {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    gap: 0 !important;
    padding: 8px 12px 2px !important;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    touch-action: pan-x;
    align-items: center;
}
.top10-style::-webkit-scrollbar { display: none; }
.top10-style:active { cursor: grabbing; }

/* Item = [chiffre | card] côte à côte */
.top10-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
    margin-right: 12px;
}

/* ---- Chiffre : hauteur = hauteur de la vidéo ---- */
.top-number {
    /* font-size = card_width * 9/16 → exactement la hauteur du thumb */
    font-size: var(--t10-num-size);
    font-weight: 900;
    color: #1a1a1a;
    -webkit-text-stroke: 3px #555;
    line-height: 1;
    pointer-events: none;
    white-space: nowrap;
    font-family: Arial Black, Impact, sans-serif;
    flex-shrink: 0;
    user-select: none;
    letter-spacing: -4px;
    transition: -webkit-text-stroke 0.25s, text-shadow 0.3s, color 0.25s;
    margin-right: 8px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    align-self: center;
}

/* Glow au hover */
.top10-item:hover .top-number {
    -webkit-text-stroke: 3px #ffffff;
    text-shadow: 0 0 12px rgba(255,255,255,0.9), 0 0 30px rgba(255,255,255,0.5);
}

/* ---- Card : largeur fluide et proportionnelle ---- */
/* !important partout pour écraser .video-card { min-width:340px !important } */
.top10-style .video-card {
    position: relative !important;
    z-index: 2 !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
    background: #111 !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.55) !important;
    margin: 0 !important;
    width: var(--t10-card-w) !important;
    min-width: var(--t10-card-w) !important;
    max-width: var(--t10-card-w) !important;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.top10-style .video-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 28px rgba(0,0,0,0.8), 0 0 0 1.5px rgba(255,255,255,0.22) !important;
    z-index: 10;
}
.top10-style .video-card .thumb-container {
    overflow: hidden;
    border-radius: 9px 9px 0 0;
    background: #000 !important;
}
.top10-style .video-card .video-info {
    position: relative;
    z-index: 3;
}

/* ── Mobile ≤ 768px ── */
@media (max-width: 768px) {
    :root {
        --t10-num-size: 13vw;
        --t10-card-w:   36vw;
    }
    .top10-style .video-card {
        width: var(--t10-card-w) !important;
        min-width: var(--t10-card-w) !important;
        max-width: var(--t10-card-w) !important;
    }
    .top-number {
        font-size: var(--t10-num-size) !important;
        letter-spacing: -3px !important;
        margin-right: 6px !important;
    }
    .top10-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
    }

    /* Logo centré, lang picker caché sur mobile (header) */
    .site-banner {
        justify-content: center !important;
        position: relative !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    .site-banner h1 {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: auto !important;
        text-align: center !important;
        margin: 0 !important;
    }
    /* Lang picker visible on mobile — compact */
    .site-banner #p4gLangPicker {
        display: block !important;
    }
}

/* Masquer chiffres en plein écran */
:fullscreen .top-number,
:-webkit-full-screen .top-number,
:-moz-full-screen .top-number { display: none !important; }


/* =============================================
   VIDEO GRID & SECTION
   ============================================= */
.video-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
}

/* ── LATEST VIDEOS 5x5 PAGINATED GRID ── */
.latest-videos-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
@media (max-width: 1100px) {
    .latest-videos-grid { grid-template-columns: repeat(4, 1fr) !important; }
}
@media (max-width: 800px) {
    .latest-videos-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
}
@media (max-width: 540px) {
    .latest-videos-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 6px !important; }
}

/* ── Force les cards à suivre la grille 5 colonnes (écrase min-width:300px global) ── */
.latest-videos-grid .video-card {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    flex-shrink: 1 !important;
}

.video-section {
    width: 85% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 40px 0 !important;
    box-sizing: border-box !important;
}

.video-section h2 {
    margin-left: 0 !important;
    padding-left: 0 !important;
    margin-bottom: 20px !important;
    font-size: 1.2rem !important;
    color: white;
    text-align: left;
}

.video-section .video-grid,
#video-container.video-grid {
    display: grid !important;
    gap: 8px !important;
    column-gap: 8px !important;
    row-gap: 15px !important;
}

.video-item {
    width: 100% !important;
    max-width: 100% !important;
}


/* =============================================
   SCROLL INDICATORS
   ============================================= */
.row-container,
.categories-wrapper {
    position: relative;
    width: 100%;
    overflow: visible;
    /* padding ensures last card's hover scale isn't clipped by parent overflow */
    padding-right: 24px;
    box-sizing: border-box;
}

.scroll-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    z-index: 100;
    pointer-events: auto !important;
    cursor: pointer;
    transition: all 0.4s ease, visibility 0.4s;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.scroll-indicator.right { right: 20px; }
.scroll-indicator.left  { left: 20px; }

.scroll-indicator.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
}

.scroll-indicator:hover {
    background: var(--brand-red) !important;
    transform: translateY(-50%) scale(1.1);
}

#secTop10 .scroll-indicator,
#secTrending .scroll-indicator {
    top: 35% !important;
}

.categories-wrapper .scroll-indicator { top: 50% !important; }


/* =============================================
   BACK BUTTON
   ============================================= */
.back-btn-container {
    display: none;
    padding: 0 4%;
    gap: 15px;
    z-index: 1100;
    position: relative;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    transition: 0.3s;
}

.btn-back:hover { background: white; color: black; }

.back-btn-container.hidden,
.categories-bar.hidden-bar { display: none !important; }

body.in-category .main-content { padding-top: 20px; }

body.in-category #gridTitle {
    margin-top: 30px !important;
    position: relative;
    z-index: 10;
}

.main-content .netflix-title { transition: margin 0.3s ease; }


/* =============================================
   DOWNLOAD BUTTON & HOME LINK
   ============================================= */
.video-actions { display: flex; gap: 15px; margin: 20px 4%; }

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-download:hover {
    background-color: #ffffff;
    color: #000000;
    transform: translateY(-3px);
    border-color: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.btn-download .icon { font-size: 1.2rem; }

.home-btn-container {
    padding: 20px 0;
    text-align: left;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.home-link {
    background: #1a1a1a;
    color: white !important;
    padding: 12px 24px;
    text-decoration: none;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.home-link i { color: white !important; }
.home-link:hover { background: #333; border-color: #444; }


/* =============================================
   UPLOAD PAGE
   ============================================= */
.upload-page-container {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.upload-card {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    border: 1px solid #333;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.upload-form input {
    background: #000;
    border: 1px solid #444;
    color: white;
    padding: 12px;
    border-radius: 6px;
}

#thumbPreviewImg {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.submit-upload-btn {
    background: #e50914;
    color: white;
    border: none;
    padding: 15px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
}

.submit-upload-btn:hover {
    background: #b20710;
    transform: scale(1.02);
}


/* =============================================
   RESPONSIVE TABLET
   ============================================= */
@media (max-width: 1150px) {
    .site-banner { justify-content: center; padding-top: 15px; }
    .site-banner h1 { position: absolute; left: 50%; transform: translateX(-50%); width: auto; text-align: center; font-size: 1.8rem; }
    .search-wrapper { width: 100%; justify-content: center; margin-bottom: 10px; }
    .search-bar-container { width: 90% !important; }
    .main-content { margin-top: 160px !important; }
}

@media (max-width: 1100px) { .categories-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .categories-grid { grid-template-columns: repeat(2, 1fr); } }


/* =============================================
   RESPONSIVE MOBILE
   ============================================= */
@media screen and (max-width: 768px) {

    html, body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        touch-action: pan-y !important;
    }

    .main-content { padding-top: 50px !important; }

    /* Hero banner toujours visible sur mobile */
    .hero-banner {
        display: flex !important;
        margin-top: 0 !important;
    }

    /* Hero slide mobile : hauteur réduite, texte centré */
    .hero-slide {
        height: 56vw !important;
        min-height: 220px !important;
        max-height: 75vh !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 5% !important;
    }

    .hero-slide-content {
        align-items: center !important;
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 90% !important;
        width: 90% !important;
        gap: 8px !important;
    }

    .hero-slide-content h2 {
        font-size: clamp(1.1rem, 5vw, 2.2rem) !important;
        margin: 0 0 6px 0 !important;
    }

    .hero-slide-content p {
        font-size: clamp(0.75rem, 2.5vw, 1rem) !important;
        margin: 0 0 10px 0 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .hero-btn-custom {
        padding: 8px 18px !important;
        font-size: 0.85rem !important;
    }

    .netflix-title {
        margin-top: 5px !important;
        margin-bottom: 10px !important;
        position: relative;
        z-index: 10;
    }

    .video-grid,
    .tendances-grid {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 10px !important;
        padding: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .top-most-views-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 20px 25% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .video-card, .top-card {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }
    /* Exception: top10 cards keep their fluid width */
    .top10-style .video-card {
        width: var(--t10-card-w) !important;
        min-width: var(--t10-card-w) !important;
        max-width: var(--t10-card-w) !important;
        margin: 0 !important;
    }


    #secHistory .netflix-row .video-card {
        min-width: 46vw !important;
        max-width: 46vw !important;
        width: 46vw !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }







    /* Espacement entre les sections sur mobile */
    #secTop10,
    #secHistory {
        margin-bottom: 18px !important;
        padding-top: 6px !important;
    }





    #secTop10 .thumb-container img,
    #secHistory .thumb-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center top !important;
    }

    .thumb-container {
        height: 110px !important;
        width: 100% !important;
        overflow: hidden !important;
        border-radius: 8px !important;
        position: relative;
    }

    .thumb-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .video-info h3 {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
        margin-top: 8px !important;
        -webkit-line-clamp: 2 !important;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .hero-banner {
        width: 100% !important;
        max-width: 100vw !important;
        height: auto !important;
        background: #000000 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        padding: 0 !important;
        padding-bottom: 36px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        margin-top: 0 !important;
    }

    /* Dots toujours visibles sur mobile */
    #heroBanner .hero-dots,
    .hero-banner .hero-dots {
        position: absolute !important;
        bottom: 10px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 999 !important;
        pointer-events: all !important;
    }

    .hero-banner .hero-dot {
        width: 8px !important;
        height: 8px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: rgba(255,255,255,0.5) !important;
        border-radius: 50% !important;
    }

    .hero-banner .hero-dot.active {
        background: #e50914 !important;
        transform: scale(1.3) !important;
    }

    .hero-logo-text { font-size: 2.7rem !important; }

    .sidebar { width: 250px !important; }

    .back-btn-container {
        margin-top: 10px;
        justify-content: center;
    }
}
/* Dernières Vidéos - alignement et espacement */
#secLatest {
    padding: 0 4%;
}

#secLatest #gridTitle {
    margin-left: 0;
    padding-left: 0;
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 15px;
}

/* secLatest uses netflix-row — 240px wide cards */
#secLatest .netflix-row .video-card {
    min-width: 240px !important;
    max-width: 240px !important;
    width: 240px !important;
}

#secLatest .netflix-row .thumb-container {
    height: auto !important;
    aspect-ratio: 16/9 !important;
}

#gridTitle {
    text-transform: uppercase;
    font-size: 2rem !important;
}

/* HERO SLIDER */
.hero-banner {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.hero-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.hero-slide {
    min-width: 100%;
    height: 90vh;
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: center;
    padding: 0 6%;
    box-sizing: border-box;
    flex-direction: row;
    justify-content: flex-start;
    position: relative;
}

.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: none;
}

.hero-slide::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.hero-slide-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 45%;
    width: 45%;
}

.hero-btn-custom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

.hero-slide-content h2 {
    /* font-size géré en inline via l'admin (title_size) */
    font-weight: 900;
    color: white;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
    text-transform: uppercase;
}

.hero-slide-content p {
    color: #ccc;
    margin: 0 0 20px 0;
    font-size: 1rem;
}

.hero-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: 0.3s;
}

.hero-dot.active { background: #e50914; transform: scale(1.3); }

/* Hero banner - fix final unique */
.hero-banner,
#heroBanner {
    overflow: hidden;
    position: relative;
    background: #000000 !important;
}

/* =============================================
   CATEGORY PAGE — bigger thumbnails, cover fit
   ============================================= */
#videoGrid.video-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
    padding: 0 !important;
}

#videoGrid .video-card {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    aspect-ratio: unset !important;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#videoGrid .video-card:hover { transform: scale(1.04); z-index: 10; }

#videoGrid .thumb-container {
    width: 100% !important;
    aspect-ratio: 16/9 !important;
    height: auto !important;
    overflow: hidden;
    border-radius: 6px;
    background: #111;
}

#videoGrid .thumb-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block;
}

#videoGrid .video-info h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff !important;
    margin: 6px 0 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* ── Espace sous les vidéos "Dernières Vidéos" — évite que les titres soient coupés au hover ── */
#videoGrid .video-card .video-info {
    padding-bottom: 8px !important;
    min-height: 38px;
}
#videoGrid .video-card {
    overflow: visible !important;
}

@media (max-width: 1200px) {
    #videoGrid.video-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 900px) {
    #videoGrid.video-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 600px) {
    #videoGrid.video-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
}

@media (max-width: 380px) {
    #videoGrid.video-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 6px !important; }
}

/* =============================================
   CATEGORY CONTAINER — marges latérales
   ============================================= */
.category-container {
    padding: 0 4% 100px 4% !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

/* =============================================
   TRI & PAGINATION
   ============================================= */
#sortBar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.sort-btn {
    background: #1e1e1e;
    border: 1px solid #444;
    color: #ccc;
    padding: 7px 15px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    white-space: nowrap;
}
.sort-btn:hover  { background: #2a2a2a; color: #fff; border-color: #666; }
.sort-btn.active { background: #e50914; border-color: #e50914; color: #fff; }

#paginationBar,
#catPaginationBar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 0 4%;
}

.page-btn {
    background: #1e1e1e;
    border: 1px solid #444;
    color: #ccc;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.page-btn:hover:not(:disabled) { background: #2a2a2a; color: #fff; border-color: #666; }
.page-btn.active   { background: #e50914; border-color: #e50914; color: #fff; pointer-events: none; }
.page-btn:disabled { opacity: 0.3; cursor: default; }

.page-dots {
    color: #666;
    padding: 0 4px;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    height: 38px;
}

@media (max-width: 600px) {
    .sort-btn      { padding: 6px 10px; font-size: 0.75rem; }
    .page-btn      { min-width: 34px; height: 34px; font-size: 0.8rem; padding: 0 7px; }
    #sortBar       { gap: 6px; }
    #paginationBar,
    #catPaginationBar { gap: 5px; padding: 0 2%; }
}

@media (max-width: 380px) {
    .sort-btn { padding: 5px 8px; font-size: 0.7rem; gap: 4px; }
    .page-btn { min-width: 30px; height: 30px; font-size: 0.75rem; }
}


/* =============================================
   VIDEO PLAYER — category tags + channel bar + social links
   ============================================= */
.video-cats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 10px;
}

.video-cat-tag {
    display: inline-block;
    background: rgba(229, 9, 20, 0.12);
    border: 1px solid rgba(229, 9, 20, 0.4);
    color: #e50914;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.video-cat-tag:hover {
    background: #e50914;
    color: #fff;
}

/* Channel / Creator bar */
.creator-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    margin: 12px 0;
}

.creator-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    transition: color 0.2s;
}

.creator-bar-left:hover { color: #e50914; }

.creator-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e50914;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
}

.creator-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
    color: #fff !important;
    border: none;
    cursor: pointer;
}

.social-btn:hover { opacity: 0.85; transform: translateY(-1px); }

.social-btn.mym    { background: #ff2d78; }
.social-btn.onlyfans { background: #00aeef; }
.social-btn.insta  { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-btn.twitter { background: #1da1f2; }
.social-btn.snap   { background: #fffc00; color: #000 !important; }
.social-btn.tiktok { background: #010101; border: 1px solid #333; }
.social-btn.telegram { background: #0088cc; }
.social-btn.custom { background: #555; }
/* =============================================
   TOP PAGE LOADING BAR
   ============================================= */
#top-progress-bar {
    position: fixed;
    top: 0; left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #ffffff, #e0e0e0, #ffffff);
    z-index: 9999999;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(255,255,255,0.8);
    border-radius: 0 2px 2px 0;
}
#top-progress-bar.done { width: 100% !important; opacity: 0; transition: width 0.2s, opacity 0.4s 0.2s; }

/* =============================================
   SKELETON LOADER
   ============================================= */
.skeleton-card {
    position: relative;
    min-width: 340px !important;
    max-width: 340px !important;
    aspect-ratio: 16/9 !important;
    border-radius: 4px;
    overflow: hidden;
    background: #1a1a1a;
    flex-shrink: 0;
}
.skeleton-shimmer {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton-card .sk-bar {
    position: absolute;
    bottom: 8px; left: 8px; right: 8px;
    height: 10px; border-radius: 4px;
    background: rgba(255,255,255,0.08);
}

/* =============================================
   VIDEO CARD BADGES
   ============================================= */
.card-badge {
    position: absolute;
    top: 8px; left: 8px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    z-index: 15;
    pointer-events: none;
}
.badge-new {
    background: #10b981;
    color: #fff;
    box-shadow: 0 2px 8px rgba(16,185,129,0.5);
}
.badge-trending {
    background: #e50914;
    color: #fff;
    box-shadow: 0 2px 8px rgba(229,9,20,0.5);
}

/* =============================================
   TOP 10 GOLD FRAME
   ============================================= */
.video-card.top10-gold {
    box-shadow: none !important;
    border-radius: 6px;
}
.video-card.top10-gold .thumb-container {
    border-radius: 4px;
    box-sizing: border-box;
}
.top10-rank-badge {
    position: absolute;
    top: 6px; left: 6px;
    background: linear-gradient(135deg, #d4af37, #f5d06e, #b8860b);
    color: #000;
    font-size: 10px;
    font-weight: 900;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    pointer-events: none;
}

/* =============================================
   FAVORITES ICON IN HOVER SIDEBAR
   ============================================= */
.nav-item .fav-count-bubble {
    background: #e50914;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    min-width: 16px; height: 16px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 4px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.3s;
}
.nav-item .fav-count-bubble.visible { opacity: 1; }

/* =============================================
   ADMIN STATS CHART
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px 20px;
    text-align: center;
    border: 1px solid #e9ecef;
}
.stat-card .stat-val {
    font-size: 2rem;
    font-weight: 900;
    color: #e50914;
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}
.chart-wrap {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}
.chart-wrap canvas { max-height: 220px; width: 100% !important; }

/* Category management */
.cat-manage-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 350px; overflow-y: auto; }
.cat-manage-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: #f8f9fa; border-radius: 8px;
    border: 1px solid #e9ecef;
}
.cat-manage-item span { flex: 1; font-weight: 600; font-size: 14px; color: #333; }
.cat-manage-item .count-tag { font-size: 11px; color: #888; background: #eee; padding: 2px 8px; border-radius: 10px; }
.btn-cat-rename { background: #3b82f6; font-size: 11px; padding: 5px 10px; }
.btn-cat-delete { background: #ef4444; font-size: 11px; padding: 5px 10px; }
.cat-add-row { display: flex; gap: 10px; margin-bottom: 16px; }
.cat-add-row input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px; }
.btn-cat-add { background: #10b981; white-space: nowrap; }
/* =============================================
   CARD HOVER OVERLAY (Netflix style)
   ============================================= */
.card-hover-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
    padding: 12px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
    pointer-events: none;
}
.video-card:hover .card-hover-overlay {
    opacity: 1;
    pointer-events: auto;
}
.cho-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.cho-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cho-play-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
    flex-shrink: 0;
    padding: 0;
}
.cho-play-btn svg { fill: #000; margin-left: 2px; }
.cho-play-btn:hover { transform: scale(1.12); background: #fff; }

.cho-fav-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.7);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    padding: 0;
}
.cho-fav-btn svg { stroke: #fff; transition: stroke 0.15s, fill 0.15s; }
.cho-fav-btn:hover { transform: scale(1.12); border-color: #e50914; }
.cho-fav-btn.active { background: rgba(229,9,20,0.3); border-color: #e50914; }
.cho-fav-btn.active svg { stroke: #e50914; fill: rgba(229,9,20,0.5); }

/* =============================================
   CARD BADGES ROW (side-by-side, no overlap)
   ============================================= */
.card-badges-row {
    position: absolute;
    top: 8px; left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 16;
    pointer-events: none;
    flex-wrap: nowrap;
}
/* Override .card-badge absolute positioning when inside row */
.card-badges-row .card-badge {
    position: static;
    display: inline-block;
}

/* Top10 rank badge in row — gold, no emoji */
.badge-top10-rank {
    background: linear-gradient(135deg, #d4af37, #f5d06e, #b8860b);
    color: #000;
    font-size: 9px;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(212,175,55,0.6);
}

/* =============================================
   TOP10 GOLD — top border only
   ============================================= */
.video-card.top10-gold::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #b8860b, #f5d06e, #d4af37, #f5d06e, #b8860b);
    border-radius: 6px 6px 0 0;
    z-index: 30;
}

/* =============================================
   HEADER CENTERED TITLE (categories / favoris)
   ============================================= */
.site-banner-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 20px;
}
.site-banner-centered h1 {
    text-align: center;
}

/* =============================================
   FAV BUTTON ANIMATIONS
   ============================================= */
@keyframes favPop {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.55); }
    60%  { transform: scale(0.88); }
    80%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}
@keyframes favUnpop {
    0%   { transform: scale(1); }
    40%  { transform: scale(0.75); }
    100% { transform: scale(1); }
}
.cho-fav-btn.fav-pop,
.fav-btn.fav-pop {
    animation: favPop 0.55s cubic-bezier(0.36,0.07,0.19,0.97) forwards;
}
.cho-fav-btn.fav-unpop,
.fav-btn.fav-unpop {
    animation: favUnpop 0.35s ease forwards;
}
/* Also animate the SVG fill on active */
.cho-fav-btn.active svg {
    fill: #e50914;
    stroke: #e50914;
    transition: fill 0.2s, stroke 0.2s;
}

/* Category tile text above background image */
.category-item { isolation: isolate; }

/* ── Avatar cliquable — hover highlight ── */
.card-channel-avatar:hover {
    border-color: #e50914 !important;
    box-shadow: 0 0 8px rgba(229,9,20,0.6);
    transform: scale(1.1);
}

/* Recently watched row alignment */
/* secHistory — cards plus grandes que les rows standard */
#secHistory .netflix-row .video-card {
    min-width: 220px !important;
    max-width: 220px !important;
    width: 220px !important;
}
#secHistory .netflix-row .video-card .thumb-container {
    width: 100% !important;
    aspect-ratio: 16/9 !important;
    height: auto !important;
    overflow: hidden;
    border-radius: 6px;
}
#secHistory .netflix-row .video-card .video-info h3 {
    font-size: 0.78rem !important;
}

.netflix-section {
    padding: 0 4%;
    margin-bottom: 30px;
    overflow: visible;
}
.netflix-section .netflix-title {
    margin-left: 0;
}
.netflix-section .row-container {
    padding: 0;
}

/* ── RANDOM NETFLIX ROWS ── */
.rnd-netflix-section {
    margin-bottom: 18px;
}
.rnd-row-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem !important;
    margin-bottom: 8px !important;
    color: #fff !important;
}
/* Fix : empecher le bleu natif du navigateur sur les liens de titre */
.rnd-row-title-link {
    color: #fff !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: color 0.2s;
}
.rnd-row-title-link:visited {
    color: #fff !important;
}
.rnd-row-title-link:hover {
    color: #e50914 !important;
}
.rnd-see-all {
    margin-left: auto;
    font-size: 0.72rem;
    color: #aaa;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    white-space: nowrap;
}
.rnd-see-all:hover { color: #e50914; }

/* ── HIDE views badge globally ── */
/* views-badge enabled globally */

/* ── ALL VIDEO TITLES WHITE ── */
.video-card .video-info h3,
.rnd-video-info h3,
.netflix-row .video-card .video-info h3 {
    color: #fff !important;
}

/* ── COMPACT CARD SIZE for all netflix-row cards ── */
.netflix-row {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: visible;
    gap: 4px;
    padding: 6px 0 14px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    align-items: stretch;
}
.netflix-row::-webkit-scrollbar { display: none; }
.netflix-row:active { cursor: grabbing; }

.netflix-row .video-card,
.netflix-row.rnd-netflix-row .video-card {
    min-width: 200px !important;
    max-width: 200px !important;
    width: 200px !important;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: visible;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch !important;
}
.netflix-row .video-card:hover,
.netflix-row.rnd-netflix-row .video-card:hover {
    transform: scale(1.06);
    z-index: 20;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
}
/* ── TOP10 override : annule le 160px de .netflix-row .video-card ── */
.top10-style.netflix-row .video-card,
.top10-style .video-card {
    width: var(--t10-card-w) !important;
    min-width: var(--t10-card-w) !important;
    max-width: var(--t10-card-w) !important;
}
.netflix-row .video-card .thumb-container,
.netflix-row.rnd-netflix-row .video-card .thumb-container {
    width: 100% !important;
    aspect-ratio: 16/9 !important;
    height: auto !important;
    overflow: hidden;
    border-radius: 4px;
    background: #111;
}
.netflix-row .video-card .thumb-container img,
.netflix-row.rnd-netflix-row .video-card .thumb-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}
/* Title always visible under thumb */
.netflix-row .video-card .video-info,
.netflix-row.rnd-netflix-row .video-card .video-info,
.rnd-video-info {
    padding: 6px 2px 4px !important;
}
.netflix-row .video-card .video-info h3,
.netflix-row.rnd-netflix-row .video-card .video-info h3,
.rnd-video-info h3 {
    font-size: 0.88rem !important;
    color: #fff !important;
    font-weight: 700 !important;
    margin: 0 0 5px 0 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    white-space: normal !important;
    line-height: 1.3 !important;
}
/* Channel row under title */
.netflix-row .video-card .video-info .chan-row,
.netflix-row.rnd-netflix-row .video-card .video-info .chan-row {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}
.netflix-row .video-card .video-info .chan-row:hover span { color: #e50914 !important; }
/* ── Card meta row (channel avatar + info) ── */
.card-meta-row { display: flex; align-items: flex-start; gap: 7px; }
.card-channel-avatar {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 900; color: #fff;
    text-transform: uppercase; letter-spacing: .02em;
}

/* ── SCROLL ARROWS on row-container ── */
.rnd-row-container {
    position: relative;
}
.rnd-row-container .scroll-indicator {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    background: rgba(0,0,0,0.75);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    width: 36px; height: 36px;
    align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
    backdrop-filter: blur(4px);
    color: #fff;
    opacity: 0;
}
.rnd-row-container:hover .scroll-indicator {
    opacity: 1;
}
.rnd-row-container .scroll-indicator:hover {
    background: rgba(229,9,20,0.85);
    transform: translateY(-50%) scale(1.1);
}
.rnd-row-container .scroll-indicator:hover {
    background: rgba(229,9,20,0.85);
    transform: translateY(-50%) scale(1.1);
}
.rnd-row-container .scroll-indicator.left  { left: -12px; }
.rnd-row-container .scroll-indicator.right { right: -12px; }
.rnd-row-container .scroll-indicator.hidden { opacity: 0 !important; pointer-events: none !important; }

/* Sections spacing */
.netflix-section {
    padding: 0 4%;
    margin-bottom: 18px;
    overflow: visible;
}
.netflix-section .netflix-title {
    margin-left: 0;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #fff;
}
.netflix-section .row-container {
    padding: 0;
}
#secTop10 {
    margin-bottom: 0;
}
/* Espacement "Récemment regardées" après top10 — desktop uniquement */
@media (min-width: 769px) {
    #secHistory {
        margin-top: 36px !important;
    }
}

/* ── RANDOM NETFLIX ROWS ── */
.rnd-netflix-section {
    margin-bottom: 18px;
}
.rnd-row-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem !important;
    margin-bottom: 8px !important;
    color: #fff !important;
}
.rnd-see-all {
    margin-left: auto;
    font-size: 0.72rem;
    color: #aaa;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    white-space: nowrap;
}
.rnd-see-all:hover { color: #e50914; }

/* ── 6 BANNER ADS bottom ── */
/* ── 4 bannières 300×250 bas de page ── */
.p4g-ads-bottom {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 30px 16px 40px;
    background: #0a0a0a;
    border-top: 1px solid #1a1a1a;
    box-sizing: border-box;
}
.p4g-ad-unit {
    width: 300px;
    height: 250px;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 6px;
}

/* Mobile overrides */
@media (max-width: 768px) {
    .netflix-row .video-card,
    .netflix-row.rnd-netflix-row .video-card {
        min-width: 38vw !important;
        max-width: 38vw !important;
        width: 38vw !important;
    }
    .rnd-row-title { font-size: 0.95rem !important; }
    .netflix-section { margin-bottom: 14px !important; }
}
/* ── DOCK LANG DROPDOWN open state ── */
#p4gDockLangDd.open {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateX(-50%) translateY(0) scale(1) !important;
}

/* ── Hero banner: first slide visible instantly ── */

/* =============================================
   HERO BANNER — SKELETON + FAST LOAD
   ============================================= */

/* État de chargement : shimmer sombre pendant que l'image arrive */
.hero-banner.hero-loading {
    background: #0a0a0a;
}
.hero-banner.hero-loading .hero-slide:first-child {
    position: relative;
    overflow: hidden;
    background: #0a0a0a !important;
}
.hero-banner.hero-loading .hero-slide:first-child::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255,255,255,0.04) 50%,
        transparent 70%
    );
    background-size: 200% 100%;
    animation: hero-shimmer 1.4s ease-in-out infinite;
}
@keyframes hero-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Transition douce quand l'image est chargée */
.hero-slide {
    transition: background-image 0s; /* pas de transition sur l'image elle-même */
}

/* Fade-in du contenu texte pour masquer le délai */
.hero-banner:not(.hero-loading) .hero-slide-content {
    animation: hero-content-in 0.4s ease both;
}
@keyframes hero-content-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-slides .hero-slide:first-child {
    will-change: transform;
}
.hero-banner {
    contain: layout style;
}

/* =============================================
   LANGUAGE PICKER (header + toutes pages)
   ============================================= */
#p4gLangPicker {
    position: relative;
    z-index: 1500;
    flex-shrink: 0;
}
#p4gLangCurrent {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}
#p4gLangCurrent:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.35);
}
#p4gLangDropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 160px;
    background: rgba(14,14,14,0.98);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34,1.2,0.64,1);
    z-index: 9999;
}
#p4gLangDropdown.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.p4g-lang-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #ccc;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s, color 0.15s;
}
.p4g-lang-opt:last-child { border-bottom: none; }
.p4g-lang-opt:hover {
    background: rgba(229,9,20,0.13);
    color: #fff;
}

/* ── INTERSTITIEL LANG PICKER ── */
#p4g-inter-lang {
    position: relative;
    margin: 0 0 14px 0;
    display: flex;
    justify-content: center;
}
#p4g-inter-lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.04em;
    padding: 8px 18px;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
#p4g-inter-lang-btn:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.4);
}
#p4g-inter-lang-dd {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px) scale(0.95);
    transform-origin: top center;
    min-width: 175px;
    background: rgba(18,18,18,0.99);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34,1.2,0.64,1);
    z-index: 99999999;
}
#p4g-inter-lang-dd.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
}
.p4g-il-opt {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 18px;
    color: #ccc;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s, color 0.15s;
}
.p4g-il-opt:last-child { border-bottom: none; }
.p4g-il-opt:hover { background: rgba(229,9,20,0.14); color: #fff; }

@media (max-width: 480px) {
    #p4gLangCurrent { font-size: 0.75rem; padding: 5px 9px; }
}

/* =============================================
   INTERSTITIEL — espace dock
   ============================================= */
#p4g-interstitiel {
    padding-bottom: max(90px, 10vh) !important;
    box-sizing: border-box !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0,0,0,0.97) !important;
    overflow: hidden !important;
}

/* =============================================
   LANGUAGE PICKER BUTTON — transparent, drapeau + initiales seulement
   ============================================= */
#p4gLangCurrent,
#p4g-inter-lang-btn {
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
}
#p4gLangCurrent:hover,
#p4g-inter-lang-btn:hover {
    background: transparent !important;
    border: none !important;
}
/* =============================================
   NETFLIX ROW CARDS — Redesigned Card Info
   ============================================= */

/* video-info zone below thumb — styled card bottom */
.video-card .video-info {
    padding: 10px 12px 12px !important;
    background: #111 !important;
    border-radius: 0 0 10px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Title */
.video-card .video-info h3 {
    margin: 0 0 8px !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    letter-spacing: 0.01em;
}

/* Channel row (avatar + name) */
.video-card .card-chan-row {
    margin-top: 0 !important;
    gap: 6px !important;
}

/* Stats row (date · views) */
.video-card .video-info > div:last-of-type {
    margin-top: 5px !important;
    padding-left: 0 !important;
}

/* Remove views-badge from card thumbnails (views shown in info below) */
.video-card .views-badge { display: none !important; }
.views-badge { display: none !important; }
.av-views-badge { display: none !important; }

/* ── Top 10 card info inherits same style ── */
.top10-style .video-card .video-info {
    padding: 8px 10px 10px !important;
    background: #111 !important;
    border-radius: 0 0 10px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.top10-style .video-card .video-info h3 {
    font-size: 0.78rem !important;
    margin-bottom: 6px !important;
}

/* ── Legacy rnd-card classes (keep compat) ── */
.rnd-card .views-badge { display: none !important; }
.rnd-netflix-card-info {
    padding: 7px 2px 6px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.rnd-card-title {
    margin: 0 0 6px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    flex: 1;
}
.rnd-card-meta { display: flex; align-items: center; gap: 8px; }
.rnd-card-avatar-wrap { flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.rnd-card-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 900; color: #fff; text-transform: uppercase;
    overflow: hidden; border: 2px solid rgba(255,255,255,0.2); transition: border-color 0.2s; flex-shrink: 0;
}
.rnd-card-avatar:hover { border-color: #e50914; }
.rnd-card-meta-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rnd-card-chan { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-height: 16px; }

/* Nom de personne — desktop : sur une ligne, mobile : wrap mot par mot */
.rnd-person-link,
.card-chan-name {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.28em;
    font-size: .75rem;
    font-weight: 700;
    color: #e5e5e5;
    text-transform: uppercase;
    letter-spacing: .02em;
    cursor: pointer;
    transition: color 0.2s;
    overflow: hidden;
    max-width: 100%;
}
.card-chan-name { font-size: .72rem; }
.rnd-name-word {
    display: inline-block;
    white-space: nowrap;
}

/* Mobile : si le nom dépasse → on wrap, chaque mot bien aligné à gauche */
@media (max-width: 600px) {
    .rnd-person-link,
    .card-chan-name {
        flex-wrap: wrap;
        white-space: normal;
        overflow: visible;
        line-height: 1.25;
    }
    .rnd-name-word {
        flex: 0 0 auto;
    }
}
.rnd-card-stats { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.rnd-stat-date,
.rnd-stat-views { font-size: 0.75rem !important; color: rgba(255,255,255,0.65) !important; font-weight: 500; white-space: nowrap; }
.rnd-stat-dot { color: rgba(255,255,255,0.3); font-size: 0.75rem; }

.rnd-stat-eye {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
}
/* ── Interstitiel actif : cacher header, sidebar, dock ── */
body:has(#p4g-interstitiel[style*="display: flex"]) .site-banner,
body:has(#p4g-interstitiel[style*="display: flex"]) .sidebar,
body:has(#p4g-interstitiel[style*="display: flex"]) #p4gLangDropdown,
body:has(#p4g-interstitiel[style*="display: flex"]) #p4gLangPicker {
    visibility: hidden !important;
    pointer-events: none !important;
}