/* =========================================================
   CineStream — style.css
   Doodstream dark theme. Semua warna & spacing dipusatkan di sini.
   ========================================================= */

:root {
    --bg:        #141414;
    --surface:   #1f1f1f;
    --card-bg:   #2c2c2c;
    --border:    #3d3d3d;
    --accent:    #ff8c00;
    --accent-dk: #e07b00;
    --text:      #e0e0e0;
    --text-dim:  #b3b3b3;
    --text-mute: #777777;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

a { color: inherit; }

/* ===== TOPBAR ===== */
header.topbar {
    background: var(--surface);
    border-bottom: 2px solid var(--accent);
    padding: 10px 16px;
    position: sticky; /* Membuat header selalu mengambang */
    top: 0;
    z-index: 999; /* Dinaikkan dari 100 ke 999 agar tidak tertimpa frame pemutar video */
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.logo span { color: #ffffff; }

/* ===== SEARCH PILL (Animasi Buka Tutup) ===== */
.search-pill {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1.5px solid transparent; /* Border disembunyikan saat tertutup */
    border-radius: 999px;
    height: 38px;
    width: 38px; /* Ukuran default hanya selebar icon */
    padding: 0;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
    margin-left: auto; /* Dorong search box ke sudut kanan */
}
.search-pill .icon { 
    color: var(--text-dim); 
    font-size: 16px; 
    cursor: pointer;
    margin: 0;
}
.search-pill input {
    width: 0; /* Sembunyikan input saat tertutup */
    opacity: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    padding: 0;
}
.search-pill button {
    display: none; /* Sembunyikan tombol cari by default */
}

/* Efek saat form pencarian diklik (Focus) */
.search-pill:focus-within {
    width: 100%;
    flex: 1;
    padding: 0 4px 0 14px;
    justify-content: flex-start;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,140,0,0.15);
}
.search-pill:focus-within .icon {
    margin-right: 8px;
}
.search-pill:focus-within input {
    width: 100%;
    opacity: 1;
}
.search-pill:focus-within button {
    display: block;
    background: var(--accent);
    border: none;
    color: #ffffff;
    height: 30px;
    padding: 0 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    margin-right: 3px;
    flex-shrink: 0;
}
.search-pill:focus-within button:hover { background: var(--accent-dk); }

/* ===== NAV (Satu Baris & Bisa di-Scroll Horizontal) ===== */
nav.main-nav {
    background: transparent;
    margin: 0;
    padding: 10px 0 2px;
    display: flex;
    gap: 8px;
    flex-wrap: nowrap; /* Ubah dari wrap ke nowrap agar tidak bertumpuk ke bawah */
    overflow-x: auto; /* Aktifkan scroll ke samping */
    -webkit-overflow-scrolling: touch; /* Scroll mulus di perangkat mobile */
    scrollbar-width: none; /* Sembunyikan scrollbar di Firefox */
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
nav.main-nav::-webkit-scrollbar {
    display: none; /* Sembunyikan scrollbar di Chrome/Safari/Edge */
}
nav.main-nav a {
    flex-shrink: 0; /* Cegah tombol mengecil tertekan tombol lain */
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    padding: 7px 16px;
    border: 1px solid var(--accent);
    border-radius: 20px;
    background: transparent;
    transition: background 0.2s, color 0.2s;
}
nav.main-nav a:hover { background: rgba(255,140,0,0.15); }
nav.main-nav a.active,
nav.main-nav a:active { background: var(--accent); color: #ffffff; }

/* ===== HERO SLIDER (index.php) ===== */
.hero-slider {
    position: relative;
    min-height: 350px;
    width: 100%;
    background: var(--bg);
    overflow: hidden;
}
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    background-size: cover;
    background-position: center 20%;
    display: flex;
    align-items: flex-end;
    z-index: 1;
}
.hero-slide.active { opacity: 1; visibility: visible; z-index: 2; }
.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20,20,20,0.05) 0%, rgba(20,20,20,0.5) 50%, rgba(20,20,20,1) 100%);
}
.hero-content {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    width: 100%;
}
.hero-rating {
    display: inline-block;
    background: rgba(0,0,0,0.7);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    border: 1px solid rgba(255,140,0,0.4);
}
.hero-content h1 {
    color: #ffffff;
    font-size: 24px;
    margin-bottom: 8px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
.hero-content p {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    max-width: 560px;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.btn-tonton {
    display: inline-block;
    background: var(--accent);
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    padding: 10px 26px;
    border-radius: 24px;
    text-decoration: none;
}
.slider-indicators {
    position: absolute;
    bottom: 16px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}
.dot {
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}
.dot.active { background: var(--accent); transform: scale(1.3); }

/* ===== SECTION & FILM GRID (dipakai index.php, watch.php, dst) ===== */
.section {
    max-width: 1200px;
    margin: 26px auto;
    padding: 0 14px;
}
.section-title {
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
    border-left: 4px solid var(--accent);
    padding-left: 10px;
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.section-head .section-title { margin-bottom: 0; }
.btn-view-more {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid var(--accent);
    padding: 5px 14px;
    border-radius: 16px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.btn-view-more:hover { background: var(--accent); color: #ffffff; }
.film-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
@media (min-width: 640px) {
    .film-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}
@media (min-width: 900px) {
    .film-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ===== FILM CARD / THUMBNAIL (standar — dipakai semua halaman) ===== */
.film-card {
    display: block;
    text-decoration: none;
    position: relative;
    background: none;
    border: none;
    border-radius: 0;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
}
.film-card:hover { opacity: 0.9; }
.poster-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    background: var(--card-bg);
    overflow: hidden;
}
.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}
.badge-quality, .badge-year {
    position: absolute;
    top: 6px;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.4;
    letter-spacing: 0.3px;
    z-index: 2;
}
.badge-quality { left: 6px; background: var(--accent); color: #ffffff; }
.badge-year { right: 6px; background: rgba(0,0,0,0.6); color: #ffffff; }
.poster-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 70%);
    padding: 20px 6px 6px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}
.poster-title {
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0 20px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 14px;
    background: var(--surface);
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--card-bg);
    transition: all 0.2s;
}
.pagination a:hover { background: var(--accent); color: #ffffff; border-color: var(--accent); }
.pagination .active { background: var(--accent); color: #ffffff; border-color: var(--accent); }

/* ===== BREADCRUMB ===== */
.breadcrumb {
    max-width: 1000px;
    margin: 12px auto 0;
    padding: 0 14px;
    font-size: 12px;
    color: var(--text-mute);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-mute); }
.breadcrumb .current { color: var(--accent); }

/* ===== WATCH HERO & PLAYER ===== */
.watch-hero {
    position: relative;
    background-size: cover;
    background-position: center 15%;
}
.watch-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20,20,20,0.35) 0%, rgba(20,20,20,0.97) 90%);
}
.watch-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 14px 26px;
}
.player-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,140,0,0.4);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.player-wrap iframe { width: 100%; height: 100%; border: none; }
.player-empty { display:flex; align-items:center; justify-content:center; height:100%; color:#a08a7a; }
.server-tabs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.server-tab {
    background: var(--surface);
    border: 1px solid var(--card-bg);
    color: var(--text-dim);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.server-tab.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }

/* ===== SHARE BUTTONS ===== */
.share-buttons { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    
    /* Dibuat lebih terang agar menonjol di background gelap */
    background: var(--card-bg); 
    border: 1px solid var(--border); 
    
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s;
}
.share-btn:hover { border-color: var(--accent); background: rgba(255,140,0,0.12); }
.share-btn.copied { border-color: var(--accent); background: rgba(255,140,0,0.12); }
.share-btn svg { flex-shrink: 0; }

/* ===== FILM INFO (watch.php) ===== */
.info-body { margin-top: 20px; }
.info-body h1 {
    font-size: 20px;
    color: var(--accent);
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    margin-bottom: 8px;
}
.info-meta {
    font-size: 12.5px;
    color: rgba(255,255,255,0.75);
    margin-bottom: 10px;
    line-height: 1.5;
}
.info-meta p { margin-bottom: 4px; }
.info-meta b { color: #fff; }
.person-link, .place-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.person-link:hover, .place-link:hover { text-decoration: underline; }
.genre-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.genre-badge {
    background: rgba(255,140,0,0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.genre-badge:hover { background: var(--accent); color: #ffffff; }
.info-desc {
    font-size: 13.5px;
    color: rgba(255,255,255,0.85);
    line-height: 1.7;
    max-width: 700px;
}
/* ===== TAG SECTION (watch.php) — Tambahkan ke style.css ===== */
/* Ditempatkan setelah .info-desc dan sebelum .share-buttons */

.film-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
    padding: 0;
}

.film-tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #b3b3b3;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.film-tag:hover {
    background: #4d4d4d;
color: #ffffff;
border-color: #4d4d4d;
    transform: translateY(-1px);
}

.film-tag:active {
    transform: translateY(0);
}

/* Mobile: tag lebih kecil */
@media (max-width: 480px) {
    .film-tags {
        gap: 6px;
        margin: 12px 0;
    }
    .film-tag {
        padding: 4px 10px;
        font-size: 11px;
        border-radius: 14px;
    }
}

/* ===== PAGE HEADER (genre/country/person/latest) ===== */
.page-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 14px 6px;
}
.page-header h1 { color: var(--accent); font-size: 20px; margin-bottom: 4px; }
.page-header p { color: var(--text-mute); font-size: 13px; }

/* ===== TAG GRID (daftar semua genre / semua negara) ===== */
.tag-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.tag-pill {
    background: var(--surface);
    border: 1px solid var(--card-bg);
    color: var(--accent);
    padding: 10px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.tag-pill:hover { border-color: var(--accent); }

/* ===== FOOTER ===== */
footer {
    /* Naikkan tingkat terang agar terpisah dari area konten utama */
    background: var(--surface); 
    border-top: 1px solid var(--border); 
    
    margin-top: 40px;
    padding: 30px 16px;
    text-align: center;
}
footer .brand { color: var(--accent); font-weight: 800; font-size: 18px; margin-bottom: 14px; }
footer .brand span { color: #ffffff; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-bottom: 14px; }
.footer-links a { color: var(--text-dim); text-decoration: none; font-size: 13px; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { color: var(--text-mute); font-size: 11px; }
