/* MovieFlix v2 - Modern Frontend */
:root {
    --primary: #e50914;
    --primary-dark: #b20710;
    --primary-glow: rgba(229, 9, 20, 0.35);
    --bg: #090909;
    --bg-2: #111111;
    --bg-card: #161616;
    --bg-hover: #1e1e1e;
    --text: #f5f5f5;
    --text-2: #b3b3b3;
    --text-3: #737373;
    --border: #2a2a2a;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 12px 40px rgba(0,0,0,0.5);
    --header-h: 68px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== HEADER / NAVBAR ========== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: var(--header-h);
    background: linear-gradient(180deg, rgba(9,9,9,0.98) 0%, rgba(9,9,9,0.85) 100%);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    height: var(--header-h);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

.logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-nav a {
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
}

.main-nav a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.06);
}

.search-form {
    display: flex;
    align-items: center;
    margin-left: auto;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 50px;
    overflow: hidden;
    width: 260px;
    transition: border-color 0.2s, width 0.3s;
}

.search-form:focus-within {
    border-color: var(--primary);
    width: 300px;
}

.search-form input {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 16px;
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.search-form button {
    background: none;
    border: none;
    padding: 10px 14px;
    color: var(--text-3);
    cursor: pointer;
    display: flex;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

.site-main { padding-top: var(--header-h); }

/* ========== HERO BANNER ========== */
.hero-banner {
    position: relative;
    min-height: 520px;
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
}

.hero-banner.hero-no-image {
    background: linear-gradient(135deg, #1a0a0a 0%, #2d1010 40%, #0a0a0a 100%);
}

.hero-banner.hero-no-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e50914' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-banner-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(9,9,9,0.97) 0%, rgba(9,9,9,0.7) 45%, rgba(9,9,9,0.3) 100%),
        linear-gradient(0deg, var(--bg) 0%, transparent 50%);
}

.hero-banner-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 60px 24px 80px;
    min-height: 520px;
}

.hero-banner-content { max-width: 600px; flex: 1; }

.pill-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.hero-banner h1 {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.hero-sub {
    color: var(--primary);
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 12px;
}

.hero-desc {
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 20px;
}

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.chip {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 13px;
    color: var(--text-2);
}

.chip-red { background: rgba(229,9,20,0.2); border-color: var(--primary); color: #ff6b6b; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-banner-poster {
    flex-shrink: 0;
    width: 240px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: none;
}

.hero-banner-poster img { width: 100%; }

.hero-empty {
    padding: 120px 24px;
    text-align: center;
}

.hero-empty h1 { font-size: 40px; margin-bottom: 12px; }
.hero-empty p { color: var(--text-2); margin-bottom: 24px; }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    background: #f40612;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--primary-glow);
}

.btn-ghost, .btn-outline {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-ghost:hover, .btn-outline:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.4);
}

/* ========== CONTENT ROWS ========== */
.home-sections { padding-bottom: 60px; }

.content-row {
    padding: 32px 0;
}

.content-row .container { padding: 0 24px; }

.row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.row-header h2 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.row-icon { font-size: 22px; }

.row-link {
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
}

.row-link:hover { text-decoration: underline; }

.scroll-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.scroll-row::-webkit-scrollbar { height: 6px; }
.scroll-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.scroll-row .movie-card {
    flex: 0 0 160px;
    scroll-snap-align: start;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.empty-msg {
    color: var(--text-3);
    padding: 40px 0;
    text-align: center;
}

/* ========== MOVIE CARDS ========== */
.movie-card { position: relative; }

.card-link { display: block; }

.card-poster {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 2/3;
    background: var(--bg-card);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.movie-card:hover .card-poster img { transform: scale(1.08); }

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.movie-card:hover .card-overlay { opacity: 1; }

.play-btn {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.quality-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.featured-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #f5c518;
    color: #000;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.card-info { padding: 10px 2px 0; }

.card-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.card-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-3);
    margin-top: 4px;
}

.card-meta .rating { color: #f5c518; }

/* ========== DETAIL PAGE ========== */
.detail-hero {
    position: relative;
    min-height: 480px;
    background-size: cover;
    background-position: center;
}

.detail-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--bg) 25%, rgba(9,9,9,0.85) 60%, rgba(9,9,9,0.5) 100%);
}

.detail-hero-content {
    position: relative;
    display: flex;
    gap: 36px;
    padding: 48px 24px 60px;
    align-items: flex-start;
}

.detail-poster {
    flex-shrink: 0;
    width: 200px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.detail-poster img { width: 100%; }

.detail-info { flex: 1; padding-top: 16px; }

.detail-info h1 {
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.detail-tagline {
    color: var(--text-2);
    font-style: italic;
    font-size: 16px;
    margin-bottom: 16px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-2);
}

.rating-badge { color: #f5c518 !important; font-weight: 700; }

.quality-tag {
    background: var(--primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
}

.detail-overview {
    color: var(--text-2);
    line-height: 1.8;
    margin-bottom: 16px;
    max-width: 720px;
    font-size: 15px;
}

.detail-credits {
    color: var(--text-3);
    font-size: 14px;
    margin-bottom: 8px;
}

.detail-credits a { color: var(--primary); }
.detail-credits a:hover { text-decoration: underline; }

/* ========== DOWNLOADS ========== */
.download-section { padding: 48px 0; }
.download-section h2 { font-size: 22px; font-weight: 700; margin-bottom: 24px; }

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.download-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: all 0.25s;
}

.download-card:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.dl-quality {
    background: var(--primary);
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px;
    min-width: 56px;
    text-align: center;
}

.dl-info { flex: 1; min-width: 0; }
.dl-label { display: block; font-size: 13px; color: var(--text-2); }
.dl-size { display: block; font-size: 12px; color: var(--text-3); }

.dl-btn {
    background: var(--bg-2);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.download-card:hover .dl-btn {
    background: var(--primary);
    border-color: var(--primary);
}

.no-downloads {
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    color: var(--text-3);
}

/* ========== SCREENSHOTS ========== */
.screenshots-section { padding: 0 0 48px; }
.screenshots-section h2 { font-size: 22px; margin-bottom: 20px; }

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.screenshot-item {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--bg-card);
    transition: transform 0.2s;
}

.screenshot-item:hover { transform: scale(1.02); }
.screenshot-item img { width: 100%; height: 100%; object-fit: cover; }

/* ========== EPISODES ========== */
.episodes-section { padding-bottom: 48px; }
.season-block { margin-bottom: 12px; }

.season-title {
    background: var(--bg-card);
    padding: 14px 18px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid var(--border);
}

.season-title:hover { border-color: var(--primary); }
.ep-count { color: var(--text-3); font-weight: 400; font-size: 13px; }
.toggle-icon { margin-left: auto; font-size: 11px; color: var(--text-3); }

.episode-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.ep-number { font-weight: 700; color: var(--primary); font-size: 13px; width: 56px; flex-shrink: 0; }
.ep-info { flex: 1; min-width: 0; }
.ep-info h4 { font-size: 14px; margin-bottom: 2px; }
.ep-info p { font-size: 12px; color: var(--text-3); }
.coming-soon { color: var(--text-3); font-size: 13px; }

/* ========== CMS PAGE ========== */
.cms-page { padding: 48px 24px 80px; }

.cms-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.cms-content h1 { font-size: 32px; margin-bottom: 24px; }
.cms-body { color: var(--text-2); line-height: 1.8; }
.cms-body h2 { color: var(--text); margin: 24px 0 12px; }
.cms-body p { margin-bottom: 16px; }
.cms-body a { color: var(--primary); }

.contact-box {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-2);
    border-radius: var(--radius);
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 48px 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.page-btn:hover, .page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.page-header { padding: 40px 24px 16px; }
.page-header h1 { font-size: 32px; font-weight: 800; margin-bottom: 6px; }
.page-header p { color: var(--text-3); }

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
    padding: 16px 0 32px;
}

.section { margin-bottom: 48px; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.empty-state { color: var(--text-3); text-align: center; padding: 60px; grid-column: 1 / -1; }

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.active { display: flex; }

.modal-content {
    position: relative;
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}

#trailerFrame iframe { width: 100%; height: 100%; border: none; }

/* ========== FOOTER ========== */
.site-footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding: 56px 0 28px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-brand p { color: var(--text-3); font-size: 14px; margin-top: 14px; line-height: 1.6; }
.footer-links h4, .footer-social h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-3);
    margin-bottom: 16px;
}

.footer-links a, .social-links a {
    display: block;
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.footer-links a:hover, .social-links a:hover { color: var(--primary); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
}

/* ========== ERROR ========== */
.error-page { text-align: center; padding: 120px 24px; }
.error-page h1 { font-size: 96px; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 16px; }
.error-page p { color: var(--text-2); margin-bottom: 32px; }

/* ========== RESPONSIVE ========== */
@media (min-width: 900px) {
    .hero-banner-poster { display: block; }
}

@media (max-width: 900px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: flex; }

    .main-nav.open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: var(--bg-2);
        padding: 16px;
        border-bottom: 1px solid var(--border);
        z-index: 199;
    }

    .main-nav.open a { width: 100%; }

    .search-form { width: 180px; }
    .search-form:focus-within { width: 200px; }

    .detail-hero-content { flex-direction: column; align-items: center; text-align: center; }
    .detail-poster { width: 160px; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .episode-item { flex-wrap: wrap; }
    .cms-content { padding: 24px; }
}