@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --bg-main: #0b0f19;
    --bg-card: #161b22;
    --primary: #00d2ff;
    --primary-glow: rgba(0, 210, 255, 0.5); /* Glow lebih lembut */
    --text-main: #ffffff;
    --text-sec: #a0aec0;
    --nav-height: 65px;
    --gradient-overlay: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; outline: none; }

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Poppins', sans-serif;
    padding-bottom: 80px; 
    overflow-x: hidden;
}

/* --- HEADER (DIKEMBALIKAN SEPERTI SEMULA AGAR TIDAK KETIMPA) --- */
header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(11, 15, 25, 0.95); /* Kembali gelap solid transparan */
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid #1f293a;
}

.brand { 
    font-size: 20px; font-weight: 700; color: var(--primary); 
    text-shadow: 0 0 10px var(--primary-glow);
    text-decoration: none; display: flex; align-items: center; gap: 8px; cursor: pointer;
}

.header-icons { 
    display: flex; 
    gap: 15px; 
    align-items: center; 
}

.icon-btn {
    background: transparent; /* Kembali transparan agar rapi */
    border: none; 
    color: white; 
    cursor: pointer; 
    display: flex; align-items: center; justify-content: center;
}

/* --- SLIDER --- */
.slider-container {
    width: 100%; overflow-x: auto; white-space: nowrap;
    padding: 15px 0;
    background: linear-gradient(to bottom, #0f1520, var(--bg-main));
    -ms-overflow-style: none; scrollbar-width: none; 
}
.slider-container::-webkit-scrollbar { display: none; }

.slide-item {
    display: inline-block; width: 280px; height: 160px;
    margin-left: 15px; border-radius: 12px;
    position: relative; overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    background: #222;
}
.slide-item:last-child { margin-right: 15px; }

.slide-item img { 
    width: 100%; height: 100%; object-fit: cover; 
    opacity: 0.8; transition: 0.3s; 
}
.slide-item:hover img { opacity: 1; transform: scale(1.05); }

.slide-caption {
    position: absolute; bottom: 0; left: 0; width: 100%;
    padding: 10px;
    background: linear-gradient(to top, black, transparent);
    white-space: normal;
}
.slide-title { font-size: 14px; font-weight: bold; color: white; line-height: 1.2; }

/* --- GRID LAYOUT --- */
.container { max-width: 1200px; margin: 0 auto; padding: 15px; }
.section-title { font-size: 18px; font-weight: 600; margin-bottom: 15px; border-left: 3px solid var(--primary); padding-left: 10px; }

.grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (min-width: 768px) { .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; } }

/* --- CARD --- */
.card {
    position: relative; border-radius: 8px; overflow: hidden;
    aspect-ratio: 2/3; cursor: pointer; background: #222;
}
.card img { width: 100%; height: 100%; object-fit: cover; }
.card-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; height: 60%;
    background: var(--gradient-overlay); display: flex; flex-direction: column; justify-content: flex-end; padding: 10px;
}
.card-title {
    font-size: 11px; font-weight: 600; color: white; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-badge {
    position: absolute; top: 6px; right: 6px; background: var(--primary);
    color: #000; font-size: 9px; font-weight: bold; padding: 2px 6px;
    border-radius: 8px; box-shadow: 0 0 8px var(--primary-glow);
}

/* --- DETAIL PAGE --- */
.banner { width: 100%; height: 220px; object-fit: cover; mask-image: linear-gradient(to bottom, black 40%, transparent 100%); }
.detail-content { margin-top: -90px; padding: 0 20px; position: relative; }
.poster-wrapper { display: flex; gap: 15px; align-items: flex-end; }
.poster-detail { width: 100px; border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,0.6); border: 2px solid var(--bg-main); background: #333; }
.info-text h1 { font-size: 18px; line-height: 1.3; margin-bottom: 5px; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.info-text span { font-size: 11px; color: var(--primary); background: rgba(0, 210, 255, 0.1); padding: 3px 8px; border-radius: 4px; }
.synopsis { font-size: 12px; color: var(--text-sec); margin-top: 15px; line-height: 1.6; max-height: 100px; overflow-y: auto; }

/* --- EPISODE LIST --- */
.ep-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 15px; }
.ep-item {
    background: #1f293a; color: white; text-align: center; padding: 10px 0; 
    border-radius: 4px; font-size: 12px; cursor: pointer; transition: 0.2s;
}
.ep-item:hover { background: var(--primary); color: black; }

/* --- VIDEO PLAYER & TOMBOL TUTUP (YANG DIMINTA) --- */
.video-container { 
    position: sticky; top: 0; background: black; z-index: 200; 
    width: 100%; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
}
iframe, video { width: 100%; height: 100%; border: none; }

.player-controls { 
    padding: 15px; 
    background: #161b22; 
    margin-bottom: 10px; 
    border-radius: 0 0 15px 15px;
}

/* Layout Header Player */
.player-header {
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 15px;
}
.player-info h1 { font-size: 14px; font-weight: bold; color: white; margin-bottom: 3px; }
.player-info span { font-size: 12px; color: var(--primary); }

/* Tombol Tutup Kapsul (Request Baru) */
.btn-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ddd;
    padding: 6px 14px;
    border-radius: 20px; /* Bentuk Kapsul */
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
}
.btn-close:active { background: #333; transform: scale(0.95); }

/* Tombol Resolusi */
.reso-group { display: flex; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.reso-label { font-size: 11px; color: #666; margin-bottom: 5px; display: block; }
.reso-btn {
    background: #333; color: white; border: 1px solid #444; padding: 6px 12px; 
    border-radius: 20px; font-size: 11px; margin-right: 5px; cursor: pointer;
}
.reso-btn.active { background: var(--primary); color: black; border-color: var(--primary); font-weight: bold; }


/* --- HISTORY ITEM (DIKEMBALIKAN SEPERTI SEMULA) --- */
.history-item { 
    display: flex; 
    gap: 15px; /* Jarak antar gambar dan teks rapi */
    background: #1f293a; /* Background lama yg rapi */
    padding: 10px; 
    margin-bottom: 10px; 
    border-radius: 8px; 
    align-items: center; 
    cursor: pointer; 
}
.history-item img { width: 60px; height: 80px; object-fit: cover; border-radius: 4px; }
.history-info div { font-size: 13px; font-weight: bold; color: white; margin-bottom: 5px; }
.history-info span { font-size: 11px; }

/* --- BOTTOM NAV DENGAN EFEK GLOW (YANG DIMINTA) --- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-height);
    background: rgba(11, 15, 25, 0.95); /* Sedikit transparan */
    backdrop-filter: blur(5px);
    border-top: 1px solid #1f293a;
    display: flex; justify-content: space-around; align-items: center;
    z-index: 1000;
}

.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: #666; font-size: 10px; transition: 0.3s; cursor: pointer;
    width: 60px;
}
.nav-item svg { width: 24px; height: 24px; fill: currentColor; transition: 0.3s; }

/* Active State dengan GLOW */
.nav-item.active { color: var(--primary); }
.nav-item.active svg { 
    fill: var(--primary); 
    filter: drop-shadow(0 0 8px var(--primary)); /* Efek Glow Cahaya */
    transform: translateY(-2px);
}

/* --- UTILS --- */
.page-section { display: none; animation: fadeIn 0.3s ease; }
.page-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8); z-index: 2000;
    display: none; align-items: center; justify-content: center;
}
.modal-box {
    background: #161b22; width: 80%; max-width: 300px;
    padding: 25px; border-radius: 15px; text-align: center;
    border: 1px solid #333; box-shadow: 0 0 20px var(--primary-glow);
}
.close-modal {
    margin-top: 20px; background: #333; color: white; border: none;
    padding: 8px 20px; border-radius: 20px; cursor: pointer;
}

.search-overlay { padding: 10px 15px; background: var(--bg-main); display: none; border-bottom: 1px solid #333; }
.search-input {
    width: 100%; padding: 10px 15px; border-radius: 8px;
    border: 1px solid #333; background: #161b22; color: white; outline: none;
}

.pagination { display: flex; justify-content: center; gap: 15px; margin-top: 30px; align-items: center; }
.page-btn { background: #1f293a; color: white; padding: 8px 20px; border-radius: 20px; cursor: pointer; font-size: 12px; }
.loading { text-align: center; padding: 40px; color: var(--text-sec); font-size: 12px; }
