/* ─── CSS Variables (injected by builder) ─── */
:root {
    --primary: %%PRIMARY%%;
    --primary-dark: %%PRIMARY_DARK%%;
    --secondary: %%SECONDARY%%;
    --accent: %%ACCENT%%;
    --bg: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-elevated: #222;
    --text: #e5e5e5;
    --text-muted: #999;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,.4);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--text); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ─── Layout ─── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ─── Header ─── */
.site-header {
    background: rgba(10,10,10,.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #222;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.logo img { height: 36px; }
.main-nav { display: flex; gap: 24px; align-items: center; }
.main-nav > a, .dropdown-toggle {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 8px 0;
    border: none;
    background: none;
    cursor: pointer;
}
.main-nav > a:hover, .dropdown-toggle:hover { color: var(--primary); }
.main-nav > a.active { color: var(--primary); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: -8px;
    background: var(--bg-card);
    border: 1px solid #2a2a2a;
    border-radius: var(--radius);
    min-width: 200px;
    padding: 6px 0;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    z-index: 101;
    max-height: 400px;
    overflow-y: auto;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-muted);
    transition: all .15s;
}
.dropdown-menu a:hover { background: var(--primary); color: white; }

.mobile-toggle { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

/* ─── Hero ─── */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}
.hero-sub { color: var(--text-muted); max-width: 600px; margin: 0 auto; font-size: 15px; }

/* ─── Film Grid ─── */
.film-section { margin-bottom: 48px; }
.film-section h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 20px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.see-all { color: var(--primary); font-size: 14px; font-weight: 500; }

.film-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}
.film-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.film-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.film-poster { position: relative; aspect-ratio: 2/3; overflow: hidden; background: #111; }
.film-poster img { width: 100%; height: 100%; object-fit: cover; }
.film-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,.8);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.film-info { padding: 10px; }
.film-info h3 { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.film-year { font-size: 12px; color: var(--text-muted); }

/* ─── Genre Grid ─── */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.genre-card {
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    transition: border-color .2s, background .2s;
}
.genre-card:hover { border-color: var(--primary); background: rgba(255,255,255,.03); }

/* ─── Year Grid ─── */
.year-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.year-card {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 15px;
    transition: opacity .2s;
}
.year-card:hover { opacity: .85; color: white; }

/* ─── Film Detail ─── */
.film-content { display: flex; gap: 30px; position: relative; padding: 20px 0; }
.film-poster-large { flex-shrink: 0; }
.film-poster-large img {
    width: 250px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.film-details { flex: 1; padding-top: 130px; }
.film-details h1 { font-size: 2rem; font-weight: 800; margin-bottom: 12px; }

.film-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.meta-tag {
    background: var(--bg-elevated);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-muted);
}
.meta-tag.rating { color: var(--accent); }

.film-genres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.genre-tag {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.genre-tag:hover { background: var(--primary); color: white; }

.film-synopsis { margin-bottom: 20px; }
.film-tagline { color: var(--text-muted); font-size: 15px; margin-bottom: 16px; font-style: italic; }
.film-synopsis h2 { font-size: 1.1rem; margin-bottom: 8px; }
.film-synopsis p { color: var(--text-muted); font-size: 15px; line-height: 1.7; }
.film-extra-meta { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0; font-size: 13px; color: var(--text-muted); }
.film-extra-meta strong { color: var(--text); }

/* ─── CTA Player Button ─── */
.player-cta { display: flex; align-items: center; gap: 12px; margin: 24px 0; }
.btn-play {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 20px rgba(229,9,20,.4);
}
.btn-play:hover { transform: scale(1.03); box-shadow: 0 6px 28px rgba(229,9,20,.5); }
.btn-play svg { flex-shrink: 0; }
.quality-badge {
    background: var(--bg-elevated);
    border: 1px solid #444;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
}

/* ─── Cast ─── */
.film-cast { margin: 24px 0; }
.film-cast h2 { font-size: 1.1rem; margin-bottom: 12px; }
.cast-grid { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.cast-card { display: flex; gap: 10px; align-items: center; min-width: 200px; background: var(--bg-card); padding: 8px; border-radius: var(--radius); }
.cast-card img { width: 60px; height: 80px; object-fit: cover; border-radius: 6px; background: #111; }
.cast-name { display: block; font-size: 13px; font-weight: 600; }
.cast-role { display: block; font-size: 11px; color: var(--text-muted); }

.film-crew { margin-bottom: 16px; font-size: 14px; color: var(--text-muted); }
.film-crew a { color: var(--primary); font-weight: 500; }

/* ─── Person Detail ─── */
.person-header { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 32px; }
.person-photo { border-radius: var(--radius); width: 180px; box-shadow: var(--shadow); }
.person-info h1 { font-size: 2rem; margin-bottom: 8px; }
.person-stats { color: var(--text-muted); font-size: 15px; }

/* ─── Listing Page ─── */
.listing-page { padding: 32px 0; }
.listing-page h1 { font-size: 2rem; font-weight: 800; margin-bottom: 16px; }
.result-count { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.seo-text { margin: 20px 0; padding: 16px; background: var(--bg-card); border-radius: var(--radius); }
.seo-text p { color: var(--text-muted); font-size: 14px; line-height: 1.7; }

/* ─── Pagination ─── */
.pagination { display: flex; justify-content: center; gap: 4px; margin: 32px 0; flex-wrap: wrap; }
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all .2s;
}
.page-link:hover, .page-link.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-dots { display: inline-flex; align-items: center; color: var(--text-muted); padding: 0 8px; }

.year-nav { display: flex; justify-content: space-between; margin-top: 24px; }
.year-link { color: var(--primary); font-weight: 500; }

/* ─── Footer ─── */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid #222;
    margin-top: 64px;
    padding: 48px 0 24px;
}
.footer-grid-seo { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; margin-bottom: 32px; }
.footer-about { padding: 16px 0; color: var(--text-muted); font-size: 13px; border-top: 1px solid #222; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.footer-col ul li { margin-bottom: 6px; }
.footer-col a { color: var(--text-muted); font-size: 13px; }
.footer-col a:hover { color: var(--primary); }
.footer-col p { color: var(--text-muted); font-size: 13px; }
/* ─── Breadcrumb ─── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); padding: 12px 0; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span:last-child { color: var(--text); }

/* ─── SEO Unique Text ─── */
.seo-unique-text { margin: 32px 0; padding: 24px; background: var(--bg-card); border-radius: var(--radius); border-left: 3px solid var(--primary); }
.seo-unique-text h2 { font-size: 1.2rem; margin-bottom: 12px; }
.seo-text-content p { color: var(--text-muted); font-size: 14px; line-height: 1.8; margin-bottom: 12px; }
.seo-text-content a { color: var(--primary); font-weight: 500; }
.seo-text-content strong { color: var(--text); }

/* ─── FAQ ─── */
.faq-section { margin: 32px 0; }
.faq-section h2 { font-size: 1.2rem; margin-bottom: 16px; }
.faq-list { display: flex; flex-direction: column; gap: 4px; }
.faq-item { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; }
.faq-question {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; background: none; border: none; color: var(--text);
    font-size: 14px; font-weight: 600; cursor: pointer; text-align: left;
}
.faq-question:hover { color: var(--primary); }
.faq-toggle { font-size: 18px; font-weight: 700; color: var(--primary); transition: transform .2s; }
.faq-item.open .faq-toggle { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-item.open .faq-answer { max-height: 500px; }
.faq-answer div { padding: 0 20px 16px; color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.faq-answer a { color: var(--primary); }

/* ─── Top 20 Section ─── */
.top20-section { border-top: 1px solid #222; padding-top: 24px; }

/* ─── Maillage genres ─── */
.maillage-genres { margin: 24px 0; }
.maillage-genres h3 { font-size: 1rem; margin-bottom: 12px; color: var(--text-muted); }

.footer-tmdb {
    display: flex; align-items: center; gap: 8px; padding: 16px 0;
    border-top: 1px solid #222; font-size: 11px; color: #555; flex-wrap: wrap;
}
.footer-tmdb a { color: #01b4e4; }
.footer-tmdb img { opacity: .6; }
.footer-bottom { text-align: center; padding-top: 16px; border-top: 1px solid #222; }
.footer-bottom p { font-size: 12px; color: #555; }

/* ─── Player Modal ─── */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.9); }
.modal-content { position: relative; z-index: 1; width: 90%; max-width: 640px; background: #111; border-radius: 12px; overflow: hidden; }
.player-screen { padding: 60px 40px; text-align: center; }
.spinner {
    width: 48px; height: 48px; border: 4px solid #333; border-top-color: var(--primary);
    border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-muted); margin-bottom: 20px; font-size: 14px; }
.progress-bar { width: 100%; height: 4px; background: #333; border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); width: 0%; transition: width .1s; }

.player-redirect { padding: 48px 40px; text-align: center; }
.redirect-icon { font-size: 48px; margin-bottom: 16px; }
.player-redirect h3 { font-size: 1.2rem; margin-bottom: 20px; line-height: 1.5; }
.btn-telegram {
    display: inline-flex; align-items: center; gap: 8px;
    background: #0088cc; color: white; padding: 14px 32px;
    border-radius: var(--radius); font-size: 16px; font-weight: 700;
    transition: opacity .2s;
}
.btn-telegram:hover { opacity: .9; color: white; }
.redirect-sub { color: var(--text-muted); font-size: 13px; margin-top: 12px; }

/* ─── Stream Player ─── */
.stream-player {
    position: relative; max-width: 960px; margin: 24px auto; border-radius: 8px; overflow: hidden;
    background: #000; cursor: pointer; aspect-ratio: 16/9;
}
.stream-player .player-poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.stream-player .player-title {
    position: absolute; bottom: 48px; left: 16px; color: white; font-size: 14px; font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,.8); z-index: 2;
}
.stream-player .play-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.35); z-index: 3; transition: background .2s;
}
.stream-player:hover .play-overlay { background: rgba(0,0,0,.5); }
.stream-player .play-btn-circle {
    width: 72px; height: 72px; border-radius: 50%; background: rgba(229,9,20,.9);
    display: flex; align-items: center; justify-content: center;
    transition: transform .2s, background .2s; box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.stream-player:hover .play-btn-circle { transform: scale(1.1); background: rgba(229,9,20,1); }
.stream-player .player-bar {
    position: absolute; bottom: 0; left: 0; right: 0; height: 36px;
    background: rgba(0,0,0,.85); display: flex; align-items: center; gap: 8px;
    padding: 0 12px; z-index: 4;
}
.stream-player .pb-time { color: #aaa; font-size: 11px; font-family: monospace; }
.stream-player .pb-track { flex: 1; height: 3px; background: #444; border-radius: 2px; overflow: hidden; }
.stream-player .pb-track-fill { height: 100%; background: var(--primary, #E50914); width: 0%; transition: width .3s; }
.stream-player .pb-icons { display: flex; gap: 8px; color: #aaa; }
.stream-player .pb-icons svg { cursor: pointer; }

/* Season/Episode selector */
.season-selector { max-width: 960px; margin: 0 auto 16px; }
.season-selector select {
    background: var(--bg-elevated, #222); color: var(--text, #e5e5e5); border: 1px solid #333;
    padding: 8px 14px; border-radius: 6px; font-size: 14px; cursor: pointer;
}
.episode-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px;
    max-width: 960px; margin: 0 auto 20px;
}
.episode-btn {
    background: var(--bg-elevated, #222); color: var(--text, #e5e5e5); border: 1px solid #333;
    padding: 8px; border-radius: 6px; font-size: 13px; text-align: center; cursor: pointer;
    transition: background .2s, border-color .2s;
}
.episode-btn:hover, .episode-btn.active { background: var(--primary, #E50914); border-color: var(--primary); color: white; }

/* ─── Mobile ─── */
.mobile-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 8px; }

@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-toggle { display: block; }
    .search-bar input { width: 120px !important; }
    body.nav-open .main-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        inset: 60px 0 0;
        background: var(--bg);
        padding: 20px;
        z-index: 99;
        gap: 4px;
        overflow-y: auto;
    }
    body.nav-open .main-nav > a,
    body.nav-open .dropdown-toggle { padding: 12px 16px; font-size: 16px; color: var(--text); }
    body.nav-open .dropdown-menu {
        position: static; display: block; border: none; box-shadow: none;
        background: var(--bg-elevated); margin: 0; padding: 0 0 0 16px;
    }
    .hero h1 { font-size: 1.6rem; }
    .film-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .film-content { flex-direction: column; }
    .film-poster-large { text-align: center; }
    .film-poster-large img { width: 200px; margin: 0 auto; }
    .film-details { padding-top: 16px; }
    .film-details h1 { font-size: 1.3rem; }
    .cast-grid { gap: 10px; }
    .stream-player { aspect-ratio: 16/9; }
    .season-selector { padding: 0 10px; }
    .episode-grid { padding: 0 10px; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
    .footer-grid { grid-template-columns: 1fr 1fr !important; }
}
