/* Reset & Base */
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.topbar {
    padding: 15px;
    background: rgba(17, 17, 17, 0.9);
    text-align: center;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(5px);
}

/* Hero Slider */
.hero-wrapper {
    position: relative;
}
.hero {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}
.hero::-webkit-scrollbar {
    display: none;
}
.hero-item {
    min-width: 100%;
    height: 70vh;
    max-height: 600px;
    background-size: cover;
    background-position: center top;
    position: relative;
    scroll-snap-align: start;
}

/* Gradien gelap di bawah agar teks & tombol terbaca jelas */
.hero-item::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 75%;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 40%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

/* Konten Hero (NAMA CLASS SUDAH DIPERBAIKI JADI .hero-content) */
.hero-content {
    position: absolute;
    bottom: 25px; /* Diturunkan mepet ke indikator */
    left: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px; /* SANGAT DIRAPATKAN */
}

/* Memaksa elemen di dalam hero tidak memiliki jarak tambahan */
.hero-content h1, 
.hero-logo,
.hero-desc,
.hero-meta {
    margin: 0 !important;
}

.badge-type {
    background: #ff1e1e;
    color: #fff;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    margin-bottom: 2px;
}
.hero-content h1 {
    font-size: 28px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    line-height: 1.2;
}

/* Ukuran Logo di Beranda (Proporsional & Padat ke bawah) */
.hero-logo {
    max-width: 60%;
    height: auto;
    max-height: 60px; 
    object-fit: contain;
    object-position: left bottom;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.8));
    margin-bottom: 2px !important;
}

.hero-meta {
    font-size: 13px;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px !important;
}
.rating {
    color: #ffd700;
    font-weight: bold;
}

/* Deskripsi dibuat lebih padat */
.hero-desc {
    font-size: 12px;
    color: #aaa;
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    margin: 4px 0 6px 0 !important; /* Jarak presisi untuk atas dan bawahnya */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* Tombol Tonton (Dibuat sedikit lebih ramping) */
.btn-play {
    background: #ff1e1e;
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.btn-play:active {
    background: #cc0000;
    transform: scale(0.95);
}

/* Dots Indicator (Diturunkan pol ke dasar layar) */
.hero-indicators {
    position: absolute;
    bottom: 8px; /* Paling mepet bawah */
    left: 20px;
    display: flex;
    gap: 6px;
    z-index: 10;
}
.dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transition: background 0.3s, width 0.3s;
}
.dot.active {
    background: #ff1e1e;
    width: 16px;
    border-radius: 4px;
}

/* Movie Rows */
.section-title {
    font-size: 16px;
    margin: 20px 0 10px 15px;
    font-weight: bold;
}
.row {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 0 15px 15px 15px;
    scroll-behavior: smooth;
}
.row::-webkit-scrollbar {
    display: none;
}
.card {
    flex: 0 0 auto;
    width: clamp(120px, 35vw, 180px); 
    cursor: pointer;
    transition: transform 0.2s ease;
}
.card:active {
    transform: scale(0.95);
}
.card img {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

/* ===============================
   HALAMAN DETAIL MOVIE
   =============================== */
.btn-back {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.detail-hero {
    width: 100%;
    height: 90vh;
    background-size: cover;
    background-position: center top;
    position: relative;
}

.detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #000 0%, rgba(8,8,8,0.5) 40%, rgba(8,8,8,0) 100%);
}

.detail-hero-content {
    position: absolute;
    bottom: 0;
    left: 4%;
    right: 4%;
    padding-bottom: 8px; /* Diturunkan mepet bawah */
    z-index: 10;
}

/* Ukuran Logo di Halaman Detail (Dirapatkan) */
.detail-logo {
    max-width: 60%;
    height: auto;
    max-height: 60px;
    object-fit: contain;
    object-position: left bottom;
    margin-bottom: 5px;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.8));
}

.detail-title {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 900;
    margin: 0 0 5px 0;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.9);
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px; /* Jarak diperkecil */
}

.match-score { color: #46d369; }
.hd-badge { border: 1px solid rgba(255,255,255,0.4); border-radius: 3px; padding: 1px 4px; font-size: 10px; }

.detail-genres {
    color: #a3a3a3;
    font-size: 13px;
    margin-bottom: 10px; /* Jarak diperkecil */
}

.btn-play-large {
    background: white;
    color: black;
    text-decoration: none;
    padding: 10px 0;
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 10px; /* Jarak diperkecil */
    transition: background 0.2s;
}
.btn-play-large:active { background: #ccc; }

.detail-desc {
    font-size: 14px;
    line-height: 1.5;
    color: #e5e5e5;
    margin-bottom: 10px; /* Jarak diperkecil */
}

.crew-info {
    font-size: 13px;
    color: #a3a3a3;
    line-height: 1.4;
}
.crew-info strong { color: #fff; }

.cast-section { padding-top: 10px; }
.cast-row {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 0 4% 30px 4%;
    scroll-behavior: smooth;
}
.cast-row::-webkit-scrollbar { display: none; }
.cast-card {
    flex: 0 0 100px;
    text-align: center;
}
.cast-card img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid rgba(255,255,255,0.1);
}
.cast-name { font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.cast-role { font-size: 11px; color: #a3a3a3; }

/* ===============================
   VIDEO PLAYER STREAMING
   =============================== */
.video-container {
    display: none; /* Disembunyikan sebelum tombol play diklik */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50; /* Berada di atas segalanya, kecuali tombol 'Back' */
    background: #000;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
}
