@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Colors - Dark Cinema Mode (RED THEME) */
    --bg-body: #05060a;
    --bg-surface: #0c0e14;
    --bg-card: #161922;
    --bg-nav: rgba(5, 6, 10, 0.85);
    
    --primary: #E50914; /* Netflix Red */
    --primary-light: #ff1f1f;
    --primary-glow: rgba(229, 9, 20, 0.3);
    --secondary: #ff8c8c;
    --accent: #E50914;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    /* Typography */
    --font-main: 'Plus Jakarta Sans', sans-serif;
    
    /* Spacing & Effects */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --shadow-lg: 0 20px 50px -15px rgba(0,0,0,0.8);
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    --glass: blur(20px) saturate(180%);
}

[data-theme="light"] {
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-nav: rgba(248, 250, 252, 0.9);
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;
    --border: rgba(15, 23, 42, 0.1);
}

/* Base Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 80px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; height: auto; border-radius: inherit; display: block; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; width: 100%; }

/* Utilities */
.py-6 { padding-top: 6rem; padding-bottom: 6rem; }
.mb-6 { margin-bottom: 6rem; }
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.fw-800 { font-weight: 800; }
.display-4 { font-size: clamp(2.5rem, 5vw, 3.5rem); line-height: 1.1; }
.h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1.5rem; }
.h2 { font-size: 2rem; font-weight: 800; margin-bottom: 1.5rem; }
.h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.25rem; }
.bg-surface { background: var(--bg-surface); }
.rounded-lg { border-radius: var(--radius-lg); }
.p-4 { padding: 1.5rem; }

/* Navbar */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; height: 80px;
    z-index: 1000; background: var(--bg-nav); backdrop-filter: var(--glass);
    border-bottom: 1px solid var(--border); display: flex; align-items: center;
}
.nav-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.6rem; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 10px; }
.logo span span { color: var(--text-main); }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-link { font-weight: 600; color: var(--text-muted); font-size: 0.95rem; }
.nav-link:hover { color: var(--primary); }

.search-form { position: relative; flex: 1; max-width: 380px; margin: 0 2rem; }
.search-input {
    width: 100%; background: var(--bg-surface); border: 1px solid var(--border);
    padding: 0.75rem 1rem 0.75rem 3rem; border-radius: var(--radius-full);
    color: var(--text-main); font-family: inherit; transition: var(--transition);
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); outline: none; }
.search-icon { position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%); color: var(--text-dim); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 28px; border-radius: var(--radius-full); font-weight: 700;
    cursor: pointer; border: none; font-family: inherit; transition: var(--transition);
    font-size: 0.95rem;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-3px); box-shadow: 0 10px 25px var(--primary-glow); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background: var(--bg-surface); border-color: var(--text-main); }
.btn-lg { padding: 16px 36px; font-size: 1.1rem; }

/* Grid & Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2rem; }
.card {
    background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden;
    border: 1px solid var(--border); transition: var(--transition); position: relative;
}
.card:hover { transform: translateY(-10px); border-color: var(--primary); box-shadow: var(--shadow-lg); }
.card-media { aspect-ratio: 2/3; overflow: hidden; position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.card:hover .card-media img { transform: scale(1.05); }
.card-rating {
    position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px); padding: 4px 10px; border-radius: 8px;
    color: #ffcc00; font-weight: 800; font-size: 0.8rem; display: flex; align-items: center; gap: 5px;
}
.card-body { padding: 1.25rem; }
.card-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--text-muted); }

/* Detail Hero Layout (movie.php / tv.php) */
.row-layout { display: flex; gap: 4rem; }
.main-column { flex: 1; min-width: 0; }
.side-column { width: 320px; flex-shrink: 0; }

.tech-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.tech-item { display: flex; flex-direction: column; gap: 0.25rem; }
.tech-label { color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; }
.tech-value { color: var(--text-main); font-weight: 600; font-size: 1rem; }

.side-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.side-card {
    display: flex; gap: 1rem; background: var(--bg-card); padding: 0.75rem;
    border-radius: var(--radius-md); border: 1px solid var(--border); transition: var(--transition);
}
.side-card:hover { border-color: var(--primary); transform: translateX(5px); background: var(--bg-surface); }
.side-card img { width: 60px; height: 90px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.side-card-info { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.side-card-info h4 { font-size: 0.9rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Detail Specifics */
.detail-hero { position: relative; min-height: 85vh; display: flex; align-items: flex-end; padding: 140px 0 80px; overflow: hidden; }
.detail-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center 15%; z-index: -1; }
.detail-poster { flex-shrink: 0; width: 360px; position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); transform: translateY(30px); }
.detail-container { display: flex; gap: 5rem; align-items: center; }
.card-rating.large { padding: 10px 18px; font-size: 1.4rem; border-radius: 12px; }
.genre-tag { display: inline-block; padding: 8px 20px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); backdrop-filter: blur(8px); border-radius: var(--radius-full); margin-right: 12px; margin-bottom: 12px; font-size: 0.95rem; font-weight: 700; color: #fff; transition: var(--transition); }
.genre-tag:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Providers */
.providers-container { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 2rem; background: rgba(255,255,255,0.03); padding: 2rem; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.provider-group { display: flex; flex-direction: column; gap: 0.75rem; }
.provider-title { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.provider-list { display: flex; flex-wrap: wrap; gap: 12px; }
.provider-item { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; position: relative; border: 1px solid var(--border); transition: var(--transition); cursor: pointer; }
.provider-item:hover { transform: scale(1.15) translateY(-5px); border-color: var(--primary); box-shadow: 0 10px 20px rgba(229, 9, 20, 0.4); }
.provider-item img { width: 100%; height: 100%; object-fit: cover; }

/* FAQ Styles */
.faq-list { display: flex; flex-direction: column; gap: 1rem; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: var(--transition); }
.faq-item summary { padding: 1.5rem; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::after { content: '+'; font-size: 1.5rem; color: var(--primary); transition: var(--transition); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-content { padding: 0 1.5rem 1.5rem; color: var(--text-muted); line-height: 1.7; border-top: 1px solid var(--border); padding-top: 1.5rem; margin-top: -1px; }

/* Cast Grid */
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.cast-card { display: flex; align-items: center; gap: 1rem; background: var(--bg-card); padding: 0.75rem; border-radius: var(--radius-md); border: 1px solid var(--border); transition: var(--transition); }
.cast-card:hover { border-color: var(--primary); background: var(--bg-surface); }
.cast-img { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border); }
.cast-info h4 { font-size: 0.95rem; margin-bottom: 2px; }

/* Video Container */
.video-container { position: relative; padding-bottom: 56.25%; height: 0; border-radius: var(--radius-lg); overflow: hidden; background: #000; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Animations */
.reveal-on-scroll { opacity: 0; transform: translateY(30px); transition: all 1s cubic-bezier(0.23, 1, 0.32, 1); }
.reveal-on-scroll.revealed { opacity: 1; transform: translateY(0); }

@media (max-width: 1200px) {
    .row-layout { gap: 2rem; }
    .side-column { width: 280px; }
}
@media (max-width: 992px) {
    .row-layout { flex-direction: column; gap: 3rem; }
    .side-column { width: 100%; }
    .detail-container { flex-direction: column; text-align: center; gap: 3rem; }
    .detail-poster { width: 280px; transform: translateY(0); margin-top: -40px; }
    .detail-meta, .detail-genres, .detail-actions { justify-content: center; }
}
@media (max-width: 576px) {
    .tech-grid { grid-template-columns: 1fr; }
    .cast-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* Footer */
.footer { background: var(--bg-surface); border-top: 1px solid var(--border); padding: 6rem 0 3rem; margin-top: 6rem; position: relative; overflow: hidden; }
.footer::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--primary), transparent); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 4rem; }
.footer-section h4 { margin-bottom: 1.5rem; font-weight: 800; color: var(--text-main); text-transform: uppercase; font-size: 1rem; letter-spacing: 0.05em; }
.footer-section p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; margin-top: 1rem; }
.footer-section ul li { margin-bottom: 12px; }
.footer-section ul li a { color: var(--text-dim); font-size: 0.95rem; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition); }
.footer-section ul li a:hover { color: var(--primary); transform: translateX(5px); }
.social-links { display: flex; gap: 1rem; margin-top: 1.5rem; }
.social-item { width: 42px; height: 42px; border-radius: 12px; background: var(--bg-card); display: flex; align-items: center; justify-content: center; color: var(--text-main); border: 1px solid var(--border); transition: var(--transition); }
.social-item:hover { background: var(--primary); color: white; transform: translateY(-5px); box-shadow: 0 10px 20px -5px rgba(229, 9, 20, 0.4); border-color: var(--primary); }
.footer-bottom { margin-top: 5rem; padding-top: 2rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; color: var(--text-dim); font-size: 0.85rem; }
.footer-bottom-links { display: flex; gap: 2rem; }
.footer-bottom-links a:hover { color: var(--text-muted); }