:root {
    --bg: #101018;
    --panel: #191923;
    --card: #20202b;
    --line: #343444;
    --line-strong: #505066;
    --text: #ffffff;
    --muted: #c4c4d0;
    --accent: #ff3838;
    --accent-btn: #e12d2d;
    --accent-btn-hover: #c41f1f;
    --radius: 10px;
}

* { box-sizing: border-box; }

/* Without this, .btn { display: inline-block } overrides the hidden attribute */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: inherit; }

img { max-width: 100%; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

:focus-visible {
    outline: 3px solid #ffd54a;
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: 10px;
    top: -60px;
    background: #fff;
    color: #000;
    padding: 10px 14px;
    border-radius: 6px;
    z-index: 100;
}
.skip-link:focus { top: 10px; }

/* Header and footer */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px;
    background: rgba(25, 25, 35, 0.95);
    border-bottom: 1px solid var(--line);
}

.logo {
    color: var(--accent);
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
}

.site-header nav a,
.site-footer nav a {
    text-decoration: none;
    margin: 0 8px;
}

.site-header nav a:hover,
.site-footer nav a:hover { text-decoration: underline; }

.site-footer {
    background: var(--panel);
    text-align: center;
    padding: 24px 20px;
    margin-top: 40px;
    color: var(--muted);
    font-size: 14px;
}

/* Layout */
main { min-height: 70vh; }

.browse,
.about,
.details-view {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 20px;
}

.status { color: var(--muted); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 11px 16px;
    border: none;
    border-radius: 6px;
    background: var(--accent-btn);
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--accent-btn-hover); }

.btn-secondary { background: var(--line); }
.btn-secondary:hover { background: var(--line-strong); }

/* Featured slider */
.featured { position: relative; overflow: hidden; background: #0c0c12; }
.slider { position: relative; --slide-time: 6.5s; }
.slides { display: grid; }

.slide {
    grid-area: 1 / 1;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 430px;
    padding: 44px 20px 86px;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}
.slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
    transition: opacity 0.9s ease;
}

.slide-bg {
    position: absolute;
    inset: -20px;
    z-index: -2;
    background-size: cover;
    background-position: center;
    filter: blur(14px) brightness(0.55) saturate(1.2);
    transform: scale(1.05);
}
.slide::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(16, 16, 24, 0.85), rgba(16, 16, 24, 0.2) 75%),
        linear-gradient(0deg, var(--bg), transparent 35%);
}

.featured-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 28px;
    align-items: center;
    perspective: 900px;
}

.featured .poster {
    width: 190px;
    flex: none;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.featured-text { flex: 1; min-width: 0; max-width: 640px; }
.featured-text h2 { font-size: 36px; line-height: 1.15; margin: 0 0 8px; }
.featured-text p { color: #e6e6ee; margin: 0 0 14px; }

.featured-label {
    color: var(--accent) !important;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.slide-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.slide-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Animation: only the visible slide moves */
.slide.is-active .slide-bg { animation: kenburns 9s ease-out both; }
.slide.is-active .poster { animation: posterIn 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.slide.is-active .featured-text > * { animation: textIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.featured-text > :nth-child(1) { animation-delay: 0.25s; }
.featured-text > :nth-child(2) { animation-delay: 0.33s; }
.featured-text > :nth-child(3) { animation-delay: 0.41s; }
.featured-text > :nth-child(4) { animation-delay: 0.49s; }
.featured-text > :nth-child(5) { animation-delay: 0.57s; }
.featured-text > :nth-child(6) { animation-delay: 0.65s; }

@keyframes kenburns {
    from { transform: scale(1.05); }
    to { transform: scale(1.2) translate(-1.5%, -1%); }
}
@keyframes posterIn {
    from { opacity: 0; transform: translateX(40px) rotateY(-14deg) scale(0.94); }
    to { opacity: 1; transform: none; }
}
@keyframes textIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}
@keyframes dotfill {
    from { width: 0; }
    to { width: 100%; }
}

/* Slider controls */
.slider-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.slider-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(16, 16, 24, 0.65);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.slider-btn:hover { background: var(--accent-btn); border-color: var(--accent-btn); }
.slider-pause { font-size: 12px; }

.dots { display: flex; align-items: center; gap: 2px; }
.dot {
    width: 22px;
    padding: 18px 4px;
    border: 0;
    background: none;
    cursor: pointer;
    transition: width 0.35s ease;
}
.dot.is-active { width: 54px; }
.dot i {
    display: block;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.35);
    overflow: hidden;
}
.dot i::after {
    content: "";
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
}
.dot.is-active i::after { animation: dotfill var(--slide-time) linear forwards; }
.slider.is-paused .dot.is-active i::after { animation-play-state: paused; }

@media (max-width: 640px) {
    .slide { min-height: 0; padding: 26px 16px 82px; align-items: flex-start; }
    .featured-inner { gap: 14px; align-items: flex-start; }
    .featured .poster { width: 104px; }
    .featured-text h2 { font-size: 22px; }
    .featured-text p { font-size: 14px; margin-bottom: 10px; }
    .slider-btn { width: 36px; height: 36px; }
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

input, select {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card);
    color: #fff;
    font-size: 15px;
    max-width: 100%;
}

#search { flex: 1 1 240px; }

/* Movie grid */
.movies {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.movie {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.15s ease;
    display: flex;
    flex-direction: column;
}

.movie:hover { transform: translateY(-3px); }

.movie-link {
    display: block;
    flex: 1;
    text-decoration: none;
    padding-bottom: 14px;
}

.movie h3 {
    margin: 12px 10px 4px;
    font-size: 16px;
}

.movie .interpreter {
    margin: 4px 10px 0;
    color: #fbbf24;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.featured-text .interpreter { color: #fbbf24; font-weight: 700; }

.movie .meta {
    margin: 0 10px;
    color: var(--muted);
    font-size: 13px;
}

.poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    overflow: hidden;
}

.poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.movie-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 10px 14px;
}

.movie-buttons .btn {
    text-align: center;
    padding: 10px 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--line-strong);
}
.btn-outline:hover { background: var(--line); }

.load-more-wrap { text-align: center; margin-top: 24px; }

/* Loading skeletons */
.skeleton {
    aspect-ratio: 2 / 3.6;
    border-radius: var(--radius);
    background: linear-gradient(90deg, var(--card) 25%, #2c2c3a 50%, var(--card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* Details view */
.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--muted);
    text-decoration: none;
}
.back-link:hover { color: #fff; text-decoration: underline; }

.details-content {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: flex-start;
}

.details-content .poster {
    width: 100%;
    max-width: 280px;
    border-radius: 8px;
}

.details-info { flex: 1; min-width: 240px; }

.details-info h1 { color: var(--accent); margin: 0 0 8px; }

.details-meta {
    color: var(--muted);
    margin: 0 0 16px;
}

.details-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 16px;
    margin: 0 0 16px;
}
.details-facts dt { color: var(--muted); }
.details-facts dd { margin: 0; }

.details-description {
    color: #e0e0ea;
    max-width: 70ch;
}

.details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.details-trailer { margin-top: 28px; }

.details-trailer iframe {
    width: 100%;
    max-width: 760px;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 8px;
}

.related { margin-top: 40px; }

.related-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(140px, 160px);
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.not-found { text-align: center; padding: 60px 0; }

@media (max-width: 500px) {
    .details-content .poster { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .movie { transition: none; }
    .skeleton { animation: none; }
}

/* Legal pages */
.legal { max-width: 760px; margin: 0 auto; padding: 25px 20px; }
.legal h1 { color: var(--accent); margin-top: 0; }
.legal h2 { margin: 28px 0 8px; font-size: 20px; }
.legal p, .legal li { color: #e0e0ea; }
.legal li { margin-bottom: 6px; }
.legal a { color: #ff8a8a; }
.legal .updated { color: var(--muted); font-size: 14px; }

/* Series and seasons */
.movie { position: relative; }
.badges {
    position: absolute; top: 8px; left: 8px; z-index: 1;
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    pointer-events: none;
}
.badge {
    padding: 3px 8px; border-radius: 999px;
    background: var(--accent-btn); color: #fff;
    font-size: 12px; font-weight: 700;
}
.badge-interpreted { background: #b45309; }
.badge-subtitled { background: #1d4ed8; }
.seasons { margin-top: 28px; }
.season-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 760px; }
.season { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.season h3 { margin: 0 0 4px; font-size: 18px; }
.season .meta { margin: 0; color: var(--muted); font-size: 14px; }
.season .details-actions { margin-top: 12px; }

/* Logo and menu */
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo img { height: 36px; width: auto; }
.menu-toggle {
    display: none; background: transparent; color: #fff; cursor: pointer;
    border: 1px solid var(--line-strong); border-radius: 6px;
    font-size: 22px; line-height: 1; padding: 6px 12px;
}
@media (max-width: 640px) {
    .menu-toggle { display: block; }
    .main-nav { display: none; width: 100%; flex-direction: column; }
    .main-nav.open { display: flex; }
    .site-header .main-nav a { margin: 0; padding: 12px 4px; border-top: 1px solid var(--line); }
}

/* Seasons and episodes */
.season-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.season-tab[aria-pressed="true"] { background: var(--accent-btn); border-color: transparent; }
.episodes-title { font-size: 18px; margin: 0 0 12px; }
.episode-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 760px; }
.episode { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.episode-head { display: flex; align-items: center; gap: 12px; }
.episode-head h3 { margin: 0; font-size: 17px; }
.episode-badge {
    flex: none; min-width: 52px; text-align: center; padding: 8px 6px;
    border-radius: 8px; background: var(--accent-btn); color: #fff;
    font-weight: 700; font-size: 13px;
}
.episode-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.episode-buttons .btn { text-align: center; }


/* Home rows */
.rows { padding: 10px 20px 0; }
.home-row { margin-top: 28px; }
.home-row h2 { margin: 0 0 12px; font-size: 22px; }
.home-row .related-row { scroll-snap-type: x proximity; }
.home-row .movie { scroll-snap-align: start; }

/* Request page */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 14px; }
.field input, .field select, .field textarea {
    width: 100%; padding: 12px; border: 1px solid var(--line);
    border-radius: 6px; background: var(--card); color: #fff; font: inherit;
}
.field textarea { min-height: 110px; resize: vertical; }
.message { min-height: 1.5em; margin: 12px 0 0; }
.message.error { color: #ff7b7b; }
.message.ok { color: #7bffa8; }
.not-found { padding-left: 20px; padding-right: 20px; }

/* Admin: version and promotion checkboxes */
.checks { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 16px; }
.checks legend { padding: 0 6px; color: var(--muted); font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; cursor: pointer; }
.check input { width: 22px; height: 22px; padding: 0; accent-color: var(--accent-btn); }

@media (prefers-reduced-motion: reduce) {
    .slide, .slide.is-active { transition: none; }
    .slide.is-active .slide-bg,
    .slide.is-active .poster,
    .slide.is-active .featured-text > * { animation: none; }
    .dot.is-active i::after { animation: none; width: 100%; }
    .slider-pause { display: none; }
}

/* WhatsApp channel card, follow buttons and floating button */
.wa-section { max-width: 1200px; margin: 20px auto 0; padding: 0 20px; }

.wa-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid #1f7a4a;
    border-left: 4px solid #25d366;
    background: linear-gradient(90deg, #0f2a20, #14161d);
    color: #fff;
    text-decoration: none;
}
.wa-card:hover { border-color: #25d366; }
.wa-icon {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #123a29;
    color: #25d366;
    display: grid;
    place-items: center;
}
.wa-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wa-text strong { font-size: 18px; }
.wa-text span { color: #9fb8aa; font-size: 14px; line-height: 1.35; }
.wa-plus {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #25d366;
    color: #06220f;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    display: grid;
    place-items: center;
}

.follow { margin-top: 18px; }
.follow h2 { font-size: 18px; margin: 0 0 10px; }
.follow-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}
.social-ig { background: linear-gradient(45deg, #f09433, #dc2743 55%, #bc1888); }
.social-fb { background: #1877f2; }
.social-tt { background: #111; border: 1px solid #fe2c55; box-shadow: inset 3px 0 0 #25f4ee, inset -3px 0 0 #fe2c55; }
.social-btn:hover { filter: brightness(1.12); }

/* A button with no link yet stays hidden */
.social-btn[href=""] { display: none; }
.follow:not(:has(.social-btn:not([href=""]))) { display: none; }

.wa-float {
    position: fixed;
    right: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 2px solid #25d366;
    background: #0f2a20;
    color: #25d366;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.wa-float:hover { background: #25d366; color: #06220f; }

@media (max-width: 640px) {
    .wa-text strong { font-size: 16px; }
    .wa-text span { font-size: 13px; }
}

/* Request: make it stand out */
.main-nav a.nav-request,
.site-header .main-nav a.nav-request {
    background: linear-gradient(90deg, #ffd23f, #ff8a00);
    color: #1a1100;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 7px 16px;
    border-radius: 999px;
    border-top: 0;
    animation: requestPulse 2.2s ease-in-out infinite;
}
.main-nav a.nav-request:hover { filter: brightness(1.08); }
@media (max-width: 640px) {
    .site-header .main-nav a.nav-request { display: inline-block; margin: 10px 0 6px; padding: 12px 20px; text-align: center; }
}

.request-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(100deg, #ffd23f, #ff8a00);
    color: #1a1100;
    text-decoration: none;
    box-shadow: 0 8px 26px rgba(255, 138, 0, 0.35);
}
.request-icon { flex: none; font-size: 42px; line-height: 1; }
.request-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.request-copy strong { font-size: 28px; line-height: 1.05; letter-spacing: 0.02em; font-weight: 900; }
.request-copy span { font-size: 14px; font-weight: 600; line-height: 1.35; }
.request-go {
    flex: none;
    padding: 12px 18px;
    border-radius: 999px;
    background: #1a1100;
    color: #ffd23f;
    font-weight: 800;
    white-space: nowrap;
    animation: requestPulse 2.2s ease-in-out infinite;
}
.request-banner:hover { filter: brightness(1.05); }

@media (max-width: 640px) {
    .request-banner { flex-wrap: wrap; }
    .request-copy { flex-basis: calc(100% - 70px); }
    .request-go { width: 100%; text-align: center; }
    .request-copy strong { font-size: 26px; }
}

.legal h1.request-title { font-size: 26px; line-height: 1.2; color: var(--text, #fff); }
.request-title span {
    display: block;
    font-size: 54px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #ffd23f, #ff8a00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.request-form .btn.btn-send,
.btn.btn-send {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: 800;
    border: 0;
    background: linear-gradient(90deg, #ffd23f, #ff8a00) !important;
    color: #1a1100;
}

@keyframes requestPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 170, 0, 0.55); }
    50% { box-shadow: 0 0 0 10px rgba(255, 170, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .nav-request, .request-go { animation: none !important; }
}

/* Language switcher (English / Kinyarwanda) */
.lang-switch {
    order: 2;
    display: inline-flex;
    border: 1px solid var(--line-strong, #3a3a4c);
    border-radius: 999px;
    overflow: hidden;
}
.lang-switch button {
    padding: 7px 12px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
    background: #25d366;
    color: #06220f;
}
@media (max-width: 640px) {
    .lang-switch { order: 1; margin-left: auto; }
    .site-header .menu-toggle { order: 2; }
    .site-header .main-nav { order: 3; }
}

@media (max-width: 640px) {
    .site-header { padding: 12px 14px; gap: 8px; }
    .site-header .logo { font-size: 19px; }
    .lang-switch button { padding: 6px 9px; }
}
