/* =========================================
   DRACINKU ULTIMATE ALL-IN-ONE CSS
   Support: Home, Search, Detail, Watch, History
   ========================================= */

:root {
    --primary: #ff4d4d;
    --primary-hover: #ff3333;
    --primary-soft: rgba(255, 77, 77, 0.15);
    --bg: #0b0c10;
    --card-bg: #1a1c22;
    --card-hover: #252830;
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
    --gold: #ffca28;
    --silver: #e0e0e0;
    --brown: #cd7f32;
    --radius: 14px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Global Reset --- */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    padding-bottom: 100px;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

a { text-decoration: none; color: inherit; }

.container { 
    padding: 0 16px; 
    max-width: 1200px; 
    margin: 0 auto; 
}
.main-footer {
    background: #0f1117;
    padding: 40px 0 20px 0;
    text-align: center;
    border-top: 1px solid #222;
    margin-top: 50px;
}

.footer-logo {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 10px;
}

.main-footer p {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 20px;
}

.footer-copy {
    color: #444;
    font-size: 0.7rem;
    border-top: 1px solid #1a1c22;
    padding-top: 20px;
}

/* --- TOP NAVIGATION (Logo) --- */
.top-nav {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.logo { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--primary); 
    letter-spacing: 1px; 
    text-transform: uppercase;
}

/* --- HERO SELECTION (Beranda - Carousel) --- */
.hero-section { 
    margin: 10px -16px 30px -16px; 
}
.hero-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 0 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.hero-scroll::-webkit-scrollbar { display: none; }

.hero-card {
    min-width: 85vw;
    height: 220px;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    scroll-snap-align: center;
    background: #222;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

@media (min-width: 768px) {
    .hero-card { min-width: 45%; height: 350px; }
}

.hero-card img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    object-position: top;
    transition: transform 0.5s ease;
}
.hero-card:hover img { transform: scale(1.05); }

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent, rgba(11, 12, 16, 0.95));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}
.hero-title { font-size: 1.3rem; font-weight: 800; margin: 0; color: #fff; }
.hero-tag {
    position: absolute; top: 12px; left: 12px;
    background: var(--primary); padding: 4px 12px;
    border-radius: 20px; font-size: 0.7rem; font-weight: 800;
    color: #fff; text-transform: uppercase;
}

/* --- DRAMA GRID (Latest, Search, History) --- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 25px 0 15px;
}
.section-header h3 { 
    font-size: 1.2rem; 
    font-weight: 800; 
    margin: 0; 
    display: flex;
    align-items: center;
    gap: 10px;
}

.grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 12px; 
    margin-top: 15px; 
}
@media (min-width: 768px) { .grid { grid-template-columns: repeat(6, 1fr); gap: 20px; } }

.card { 
    background: var(--card-bg); 
    border-radius: 10px; 
    overflow: hidden; 
    position: relative;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.05);
}
.card:hover { transform: translateY(-5px); border-color: var(--primary); }
.card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.card-info { padding: 8px; }
.card-title { 
    font-size: 0.8rem; 
    font-weight: 600; 
    height: 2.4em; 
    overflow: hidden; 
    line-height: 1.2;
}
.search-wrapper { margin: 20px 0 30px; }
.search-input-group {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    border: 1px solid #333;
    transition: var(--transition);
}
.search-input-group:focus-within { border-color: var(--primary); box-shadow: 0 0 10px var(--primary-soft); }
.search-input-group i { color: #666; font-size: 1rem; }
.search-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 10px 15px;
    font-size: 0.95rem;
}
.search-input-group button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 800;
    cursor: pointer;
}
.no-results { text-align: center; padding: 50px 20px; color: #555; }
.no-results i { font-size: 3rem; margin-bottom: 15px; }
/* FOR YOU / RECOMMENDATION STYLES */
.foryou-container { display: flex; flex-direction: column; gap: 15px; margin-top: 15px; }

.foryou-row {
    display: flex;
    gap: 15px;
    background: var(--card-bg);
    padding: 12px;
    border-radius: var(--radius);
    align-items: center;
}

.foryou-img {
    width: 80px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.foryou-details { flex: 1; overflow: hidden; }

.foryou-title { font-weight: 800; font-size: 1rem; margin-bottom: 5px; color: #fff; }

.foryou-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 8px;
    line-height: 1.3;
}

.foryou-meta { display: flex; align-items: center; gap: 12px; }

.play-count { font-size: 0.75rem; color: #aaa; }
.play-count i { color: var(--primary); font-size: 0.7rem; }

.corner-tag {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    color: #fff;
}

/* TAG CARD (Horizontal Books) */
.tag-card {
    background: #1e2026;
    border-radius: var(--radius);
    padding: 15px 0;
    margin: 10px 0;
}

.tag-card-header {
    padding: 0 15px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #eee;
}

.tag-books-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 0 15px;
}

.tag-books-scroll::-webkit-scrollbar { display: none; }

.tag-book-item { min-width: 90px; width: 90px; }
.tag-book-item img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 6px; }
.tag-book-title { font-size: 0.7rem; margin-top: 6px; text-align: center; color: #ccc; }

/* UTILITY */
.text-ellipsis-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.download-icon {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

button.btn-play-large {
    font-family: inherit;
    outline: none;
    justify-content: center;
}

.instruction-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid #333;
    margin-bottom: 30px;
}

.instruction-card h3 { 
    color: var(--gold); 
    margin-top: 0;
    font-size: 1rem;
}

.instruction-card ul li {
    font-size: 0.85rem;
    color: var(--text-dim);
    list-style: none;
}

/* --- HISTORY TAG (Badge Lanjut Nonton) --- */
.last-watched-tag {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 2;
    font-weight: bold;
}

/* --- TRENDING BOARD & RANKING (Beranda) --- */
.trending-board { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; }
.trending-row {
    display: flex; align-items: center;
    background: var(--card-bg); padding: 12px;
    border-radius: var(--radius); gap: 15px;
    transition: var(--transition);
}
.trending-row:hover { background: var(--card-hover); }

.rank-num { font-size: 1.5rem; font-weight: 800; min-width: 35px; text-align: center; }

/* Ranking Colors */
.rank-1 { color: var(--gold); font-size: 2.2rem; text-shadow: 0 0 10px rgba(255, 202, 40, 0.3); }
.rank-2 { color: var(--silver); font-size: 1.8rem; }
.rank-3 { color: var(--brown); font-size: 1.6rem; }
.rank-4, .rank-5, .rank-6, .rank-7, .rank-8, .rank-9, .rank-10 { color: #444; }

.trending-mini-img { width: 45px; height: 60px; object-fit: cover; border-radius: 6px; }
.trending-details { flex: 1; overflow: hidden; }
.trending-row-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.95rem; }
.trending-meta { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; display: flex; gap: 10px; }
.hot-count i { color: var(--primary); }

/* --- VIDEO PLAYER FIX (Non-Sticky) --- */
.video-container { 
    width: 100%; 
    background: #000; 
    line-height: 0; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
video { 
    width: 100%; 
    height: auto; 
    max-height: 80vh; 
    object-fit: contain; 
}

/* --- DETAIL & WATCH INFO --- */
.watch-info, .detail-header { margin: 24px 0; }
.detail-header { display: flex; gap: 20px; align-items: flex-start; }
.detail-cover { 
    width: 125px; 
    border-radius: 10px; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); 
    flex-shrink: 0;
}
.title { font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 15px; color: var(--text-dim); font-size: 0.85rem; margin-bottom: 15px; }
.desc { 
    color: var(--text-dim); 
    font-size: 0.9rem; 
    line-height: 1.7; 
    padding-left: 12px;
    border-left: 2px solid var(--primary-soft);
}

.btn-play-large {
    background: var(--primary);
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    color: white;
}

/* --- EPISODE SELECTION --- */
.section-title { 
    font-size: 1.1rem; 
    font-weight: 800; 
    margin: 30px 0 15px; 
    color: var(--primary); 
    display: flex; 
    align-items: center; 
    gap: 8px;
}
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(55px, 1fr)); gap: 10px; }
.ep-btn {
    background: var(--card-bg);
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.05);
}
.ep-btn.active { 
    background: var(--primary); 
    border-color: var(--primary); 
    box-shadow: 0 4px 12px var(--primary-soft); 
}

/* --- BOTTOM NAVIGATION (Emak-Emak Friendly) --- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 75px; background: rgba(26, 28, 34, 0.98);
    backdrop-filter: blur(15px); display: flex;
    justify-content: space-around; align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05); z-index: 2000;
}
.nav-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    color: #707070; 
    font-size: 0.7rem; 
    flex: 1; 
    font-weight: 600;
}
.nav-item i { font-size: 1.4rem; margin-bottom: 4px; }
.nav-item.active { color: var(--primary); }

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }