:root {
    /* --- WARNA MODERN AESTHETIC --- */
    --primary: #E91E63;
    --primary-gradient: linear-gradient(135deg, #E91E63, #9C27B0);
    --primary-glow: rgba(233, 30, 99, 0.5);
    --wa-color: #25D366; 
    
    --bg-dark: #0a0a0a;
    --surface: #141414;
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --nav-height: 65px;
}

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-dark);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding-bottom: calc(var(--nav-height) + 20px);
}

/* HEADER */
header {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-container {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 15px; max-width: 1200px; margin: 0 auto;
}

.logo-area { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.logo-icon { color: var(--primary); font-size: 1.4rem; filter: drop-shadow(0 0 8px var(--primary-glow)); }
.logo-text { 
    font-weight: 800; font-size: 1.2rem; letter-spacing: 0.5px;
    background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.search-area { flex: 1; margin: 0 15px; }
.search-box {
    background: #222; border-radius: 50px; padding: 8px 15px;
    display: flex; align-items: center; border: 1px solid transparent; transition: 0.3s;
}
.search-box:focus-within { border-color: var(--primary); background: #000; box-shadow: 0 0 15px var(--primary-glow); }
.search-box input { background: transparent; border: none; color: white; width: 100%; margin-left: 10px; font-family: 'Poppins', sans-serif; }

.menu-btn { background: transparent; border: none; color: white; font-size: 1.4rem; cursor: pointer; }

/* BOTTOM NAV */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: var(--nav-height);
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex; justify-content: space-around; align-items: center;
    z-index: 9999;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
}

.nav-item {
    cursor: pointer; text-decoration: none; color: #888;
    display: flex; flex-direction: column; align-items: center;
    font-size: 0.65rem; gap: 4px; transition: 0.3s;
    width: 20%; background: none; border: none; padding: 0;
}
.nav-item i { font-size: 1.2rem; margin-bottom: 2px; transition: 0.3s; }
.nav-item.active { color: var(--primary); text-shadow: 0 0 15px var(--primary); }
.nav-item.active i { transform: translateY(-3px); filter: drop-shadow(0 0 10px var(--primary)); }

/* LAYOUT */
.main-wrapper { max-width: 1200px; margin: 0 auto; padding: 15px; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.page-header { margin-bottom: 20px; border-left: 4px solid var(--primary); padding-left: 15px; }
.page-header h2 { margin: 0; font-size: 1.4rem; }

/* HERO BANNER + GLOW EFFECT */
@keyframes softGlowMove {
    0% { box-shadow: 0 0 20px rgba(233, 30, 99, 0.3), 0 0 40px rgba(156, 39, 176, 0.2); }
    50% { box-shadow: 0 0 25px rgba(233, 30, 99, 0.4), 0 0 50px rgba(156, 39, 176, 0.3); }
    100% { box-shadow: 0 0 20px rgba(233, 30, 99, 0.3), 0 0 40px rgba(156, 39, 176, 0.2); }
}

.hero-banner {
    background: linear-gradient(45deg, #1a1a1a, #0d0d0d); 
    border-radius: 15px; padding: 30px 20px; margin: 0 0 30px 0; text-align: center;
    position: relative; overflow: hidden; border: none !important;
}
.hero-banner.glow-effect { animation: softGlowMove 4s ease-in-out infinite alternate; }

.hero-content h1 { margin: 0; font-size: 1.8rem; line-height: 1.2; }
.hero-content p { color: var(--text-muted); font-size: 0.9rem; margin-top: 5px; }

.content-section { margin-bottom: 30px; }
.section-header { display: flex; align-items: center; gap: 10px; margin: 15px 0; }
.section-header h2 { margin: 0; font-size: 1.3rem; }
.pulse-dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

.grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (min-width: 768px) { .grid-container { grid-template-columns: repeat(5, 1fr); } }

.card {
    background: var(--surface); border-radius: 12px; overflow: hidden;
    position: relative; transition: transform 0.2s;
}
.card:active { transform: scale(0.97); }
.card-img-wrapper { position: relative; padding-top: 140%; }
.card img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.card-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, black, transparent); padding: 20px 8px 8px 8px;
}
.card-badge {
    position: absolute; top: 6px; right: 6px; 
    background: var(--primary-gradient);
    color: white; font-size: 0.6rem; padding: 3px 8px; border-radius: 20px;
    font-weight: 700; border: none;
    box-shadow: 0 4px 10px var(--primary-glow);
}
.card-title { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

.glow-btn {
    background: var(--primary-gradient);
    color: white; border: none; padding: 12px; border-radius: 12px;
    font-weight: 600; cursor: pointer; margin-top: 20px; width: 100%;
    box-shadow: 0 5px 20px var(--primary-glow);
}

/* SIDEBAR & INSTALL APP */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
    z-index: 1001; opacity: 0; visibility: hidden; transition: 0.3s;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }
.sidebar {
    position: fixed; top: 0; right: -280px; width: 280px; height: 100%;
    background: #111; z-index: 1002; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column; border-left: 1px solid #333;
}
.sidebar.active { right: 0; }
.sidebar-header { padding: 20px; display: flex; justify-content: space-between; border-bottom: 1px solid #222; }
.sidebar-content { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 20px; }
.profile-card { background: #1a1a1a; padding: 20px; border-radius: 15px; text-align: center; border: 1px solid #333; }
.dev-badge { background: rgba(255,255,255,0.1); font-size: 0.7rem; padding: 4px 10px; border-radius: 20px; display: inline-block; margin-bottom: 10px; color: #aaa; }

/* FIX TOMBOL INSTALL (UPDATED) */
.install-btn {
    background: var(--surface); color: var(--primary); border: 1px solid var(--primary);
    padding: 12px; border-radius: 10px; font-weight: bold; cursor: pointer;
    display: flex; align-items: center; justify-content: center; /* Teks di tengah */
    gap: 10px; transition: 0.3s;
    width: 100%; /* Lebar Penuh */
}
.install-btn:hover { background: var(--primary); color: white; }

.social-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 6px 12px; border-radius: 8px; 
    text-decoration: none; color: white; 
    font-weight: 500; font-size: 0.75rem; 
    border: 1px solid rgba(255,255,255,0.1); width: 100%;
}
.social-btn.ig { background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584); }
.social-btn.wa { background: #128C7E; }
.sidebar-footer { margin-top: auto; text-align: center; color: #555; font-size: 0.75rem; }

/* PLAYER UI */
.back-nav { background: none; border: none; color: #ccc; margin-bottom: 15px; font-size: 1rem; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.video-wrapper-glass { border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid #333; position: relative; }
video { width: 100%; display: block; }

/* SUBTITLE SYSTEM */
video::cue {
    background-color: transparent !important;
    color: #ffffff !important;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    font-family: 'Poppins', sans-serif; font-weight: 600;
    font-size: clamp(1rem, 4vw, 1.5rem) !important; line-height: 1.5 !important;
}
video::-webkit-media-text-track-container { overflow: visible !important; transform: translateY(-20%) !important; }
video:fullscreen::-webkit-media-text-track-container { transform: translateY(-30%) !important; }

.drama-info-glass { background: #161616; border-radius: 15px; padding: 20px; margin-top: 15px; border: 1px solid #222; }
.drama-stats { display: flex; gap: 15px; font-size: 0.85rem; color: var(--text-muted); margin: 10px 0; }
.drama-stats i { color: var(--primary); }

/* SHARE & SAVE BUTTONS */
.drama-actions { margin: 15px 0; display: flex; flex-wrap: wrap; gap: 10px; }
.glow-btn-small {
    background: var(--primary-gradient); color: white; border: none; padding: 8px 16px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 12px var(--primary-glow); display: inline-flex; align-items: center; gap: 8px;
}
.btn-share {
    background: #1a1a1a; color: var(--wa-color); border: 1px solid var(--wa-color);
    box-shadow: none;
}
/* Tombol Simpan (Default Hitam) */
.btn-save {
    background: #1a1a1a; color: #fff; border: 1px solid #333;
    box-shadow: none; transition: 0.3s;
}
/* Tombol Simpan (Aktif/Disimpan - Merah) */
.btn-save.active {
    background: var(--primary); border-color: var(--primary); color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}
.next-btn { background: linear-gradient(45deg, #ff512f, #dd2476); box-shadow: 0 4px 15px rgba(221, 36, 118, 0.4); }
.next-btn:active { transform: scale(0.95); }
.next-btn:disabled { background: #333; color: #777; box-shadow: none; cursor: not-allowed; }

/* HISTORY TABS */
.history-tabs {
    display: flex; gap: 20px; margin-bottom: 20px; border-bottom: 1px solid #333;
}
.history-tab {
    background: none; border: none; color: #888; padding: 10px 5px; 
    font-size: 0.9rem; cursor: pointer; position: relative; transition: 0.3s;
}
.history-tab.active { color: var(--primary); font-weight: 700; }
.history-tab.active::after {
    content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; 
    height: 3px; background: var(--primary); border-radius: 3px 3px 0 0;
}

/* RECOMMENDATIONS SLIDER */
.rec-section { margin-top: 30px; }
.rec-section h3 { font-size: 1rem; margin-bottom: 10px; color: #ddd; }
.scrolling-wrapper { display: flex; overflow-x: auto; gap: 12px; padding-bottom: 10px; margin-top: 10px; }
.scrolling-wrapper .card { min-width: 120px; width: 120px; }

/* AUTO NEXT */
.auto-next-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 10; animation: fadeIn 0.3s;
}
.auto-next-overlay p { font-size: 1.1rem; margin-bottom: 15px; color: #fff; font-weight: 600; }
.countdown-circle {
    width: 60px; height: 60px; border-radius: 50%; border: 4px solid var(--primary);
    display: flex; justify-content: center; align-items: center;
    font-size: 1.5rem; font-weight: bold; color: var(--primary);
    margin-bottom: 20px; box-shadow: 0 0 20px var(--primary-glow); animation: pulse 1s infinite;
}
.overlay-btns { display: flex; gap: 15px; }
.btn-cancel { background: transparent; border: 1px solid #fff; color: #fff; padding: 8px 20px; border-radius: 20px; cursor: pointer; }
.btn-now { background: var(--primary-gradient); border: none; color: #fff; padding: 8px 20px; border-radius: 20px; cursor: pointer; font-weight: bold; }

.episode-container { margin-top: 25px; scroll-margin-top: 80px; }
.episode-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-height: 250px; overflow-y: auto; }
.ep-btn { background: #222; border: 1px solid #333; color: white; padding: 10px 0; border-radius: 8px; font-size: 0.85rem; cursor: pointer; }
.ep-btn.active { background: var(--primary-gradient); border: none; font-weight: 700; box-shadow: 0 2px 10px var(--primary-glow); }

.loading-spinner { width: 40px; height: 40px; border: 4px solid #333; border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 30px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.source-badge { background: var(--primary-gradient); color: #fff; padding: 3px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: bold; border: none; box-shadow: 0 2px 8px var(--primary-glow); }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag-chip {
    background: rgba(255,255,255,0.05); padding: 8px 15px; border-radius: 30px; font-size: 0.85rem; color: #ccc;
    cursor: pointer; border: 1px solid rgba(255,255,255,0.1); transition: 0.3s;
}
.tag-chip:hover { border-color: var(--primary); color: white; background: rgba(255,255,255,0.1); }
.tag-chip:active { background: var(--primary-gradient); color: white; border-color: transparent; }
