/* --- RESET & VARIABLES --- */
:root {
    --bg-black: #0f0f0f;
    --bg-main: #141414; /* Tambahan dari watch.html */
    --main-red: #e50914;
    --text-white: #ffffff;
    --text-muted: #b3b3b3;
    --padding-side: 4%;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    background: var(--bg-black); 
    color: var(--text-white); 
    font-family: 'Saira', sans-serif; 
    overflow-x: hidden; 
    user-select: none; 
    padding-bottom: 0;
}
a { text-decoration: none; color: inherit; transition: 0.3s; }

/* --- HEADER --- */
.movie-header {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    padding: 20px var(--padding-side);
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
}
.logo { font-size: 1.8rem; font-weight: 700; color: var(--main-red); letter-spacing: 1px; }
.nav-links { display: flex; align-items: center; }

/* --- SEARCH BAR --- */
.search-wrapper {
    display: flex; align-items: center;
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50px;
    padding: 8px 20px; width: 350px; transition: all 0.3s ease;
}
.search-wrapper:focus-within { background: #000; border-color: #333; }
.search-input { background: transparent; border: none; color: #fff; width: 100%; outline: none; font-family: 'Saira', sans-serif; font-size: 0.95rem; }
.search-input::placeholder { color: #aaa; }
.search-btn { background: transparent; border: none; color: #aaa; cursor: pointer; padding-left: 10px; }
.search-btn:hover { color: #e50914; transform: scale(1.1); }
.search-clear { background: transparent; border: none; color: var(--main-red); cursor: pointer; font-size: 1.2rem; padding: 0 10px; display: none; font-weight: bold; }
.show-flex { display: flex !important; }

/* Mobile Search */
@media (max-width: 768px) {
    .search-wrapper { 
        position: fixed; bottom: 0; left: 0; width: 100%; 
        border-radius: 0; background: #111; border: none; border-top: 1px solid #333; 
        z-index: 2000; padding: 15px var(--padding-side); box-shadow: 0 -5px 20px rgba(0,0,0,0.5); 
    }
    body { padding-bottom: 80px; } 
    .nav-links { width: 100%; }
}

/* --- HERO SLIDER (Home) --- */
.hero-wrapper { 
    position: relative; 
    width: 100%; 
    height: 85vh; 
    overflow: hidden; 
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.hero-container { 
    display: flex; 
    width: 100%; 
    height: 100%; 
    cursor: grab;
}

.hero-container:active {
    cursor: grabbing;
}

.hero-slide {
    flex: 0 0 100%; 
    width: 100%; 
    height: 100%; 
    background-size: cover; 
    background-position: center; 
    display: flex; 
    align-items: center; 
    position: relative;
    text-decoration: none;
}
.hero-content { padding-left: var(--padding-side); max-width: 800px; z-index: 2; pointer-events: none; }
.hero-content * { pointer-events: auto; }
.hero-tag { background: var(--main-red); padding: 5px 15px; border-radius: 50px; display: inline-block; margin-bottom: 15px; font-weight: bold; }
.hero-title { font-size: 3.5rem; margin-bottom: 10px; line-height: 1.1; text-shadow: 2px 2px 8px rgba(0,0,0,0.8); }
.hero-desc { color: #ddd; margin-bottom: 25px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 1.1rem; text-shadow: 1px 1px 4px rgba(0,0,0,0.8); }
.hero-btn { background: white; color: black; padding: 12px 30px; font-weight: 600; border-radius: 4px; width: fit-content; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.2s; }
.hero-btn:hover { background: #ddd; }
.hero-indicators { position: absolute; bottom: 30px; left: var(--padding-side); display: flex; gap: 10px; z-index: 20; }
.dot { width: 10px; height: 10px; background: #555; border-radius: 50%; cursor: pointer; transition: 0.3s; }
.dot.active { background: var(--main-red); width: 30px; border-radius: 10px; }

/* --- SECTION & SLIDERS (Home & Watch) --- */
.content-section { padding: 40px 0 0 var(--padding-side); margin-bottom: 30px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.section-heading a { font-size: 1.4rem; font-weight: 700; border-left: 4px solid var(--main-red); padding-left: 15px; display: flex; align-items: center; }
.section-heading a:hover { color: var(--main-red); }
.section-more-link { font-size: 0.8rem; color: #e50914; font-weight: 700; padding-right: var(--padding-side); white-space: nowrap; transition: 0.2s; }
.section-more-link:hover { text-decoration: underline; opacity: 0.8; }

/* Horizontal Slider (Unified) */
.horizontal-slider {
    display: flex; gap: 15px; overflow-x: auto; 
    padding: 20px 0; /* Padding seragam agar hover tidak terpotong */
    scroll-behavior: smooth; -webkit-overflow-scrolling: touch; 
    scroll-snap-type: x mandatory; scrollbar-width: none;
}
.horizontal-slider::-webkit-scrollbar { display: none; }

/* Content Card (Unified) */
.content-card { 
    min-width: 160px; width: 160px; 
    transition: 0.3s; cursor: pointer; flex-shrink: 0; 
    scroll-snap-align: start; position: relative; 
}
.content-card:hover { transform: scale(1.05); z-index: 10; }
.content-card img { width: 100%; height: 240px; object-fit: cover; border-radius: 8px; background: #222; }
.card-rating { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.8); padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; color: #ffd700; font-weight: bold; }
.card-info { margin-top: 8px; }
.card-title { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: #fff; }
.card-year { font-size: 0.8rem; color: #888; margin-top: 2px; }

/* --- GRID LAYOUT (Browse & Search) --- */
/* Menggantikan .browse-grid dan .search-grid */
.media-grid-container { padding: 120px var(--padding-side) 40px; min-height: 80vh; }
.page-title { font-size: 2rem; margin-bottom: 30px; border-left: 5px solid var(--main-red); padding-left: 20px; font-weight: 700; }
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px 15px;
}
.media-grid .content-card { width: 100%; min-width: auto; } /* Reset width untuk grid */
.no-results { text-align: center; color: var(--text-muted); margin-top: 50px; font-size: 1.2rem; }

/* Pagination Button */
.load-more-container { text-align: center; margin-top: 50px; }
.load-more-btn {
    background: var(--main-red); color: white; border: none;
    padding: 12px 40px; font-size: 1rem; font-weight: bold;
    border-radius: 30px; cursor: pointer; transition: 0.3s; font-family: inherit;
}
.load-more-btn:hover { background: #b2070f; transform: scale(1.05); }
.load-more-btn:disabled { background: #333; color: #666; cursor: not-allowed; }

/* --- WATCH PAGE --- */
.player-wrapper {
    position: relative; padding-top: 56.25%; background: #000;
    width: 100%; margin-top: 0; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.player-frame { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.watch-container { width: 100%; padding: 40px var(--padding-side); max-width: none; }

.control-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; margin-bottom: 30px; margin-top: 20px; }
.server-control { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.server-label { color: var(--text-muted); font-size: 0.9rem; margin-right: 5px; }
.server-btn { background: transparent; border: 1px solid #444; color: #fff; padding: 8px 20px; border-radius: 50px; cursor: pointer; font-family: inherit; transition: 0.3s; font-size: 0.85rem; font-weight: 600; }
.server-btn.active, .server-btn:hover { background: var(--main-red); border-color: var(--main-red); }

.share-btn { background: #222; border: 1px solid #444; color: #fff; padding: 8px 20px; border-radius: 50px; cursor: pointer; font-family: inherit; transition: 0.3s; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.share-btn:hover { background: #fff; color: #000; }

.tv-controls { background: #1f1f1f; border: 1px solid #333; border-radius: 8px; padding: 20px; margin-bottom: 30px; display: none; }
.tv-controls-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
.season-select { background: #333; color: white; border: 1px solid #444; padding: 8px 15px; border-radius: 4px; font-family: inherit; font-size: 0.95rem; cursor: pointer; }
.episodes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 10px; max-height: 200px; overflow-y: auto; padding-right: 5px; }
.episodes-grid::-webkit-scrollbar { width: 6px; }
.episodes-grid::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
.ep-btn { background: #2a2a2a; border: 1px solid #333; color: #ccc; padding: 10px 0; text-align: center; border-radius: 4px; cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: 0.2s; }
.ep-btn:hover { background: #444; color: white; }
.ep-btn.active { background: var(--main-red); border-color: var(--main-red); color: white; box-shadow: 0 0 10px rgba(229, 9, 20, 0.4); }

.movie-info { display: grid; grid-template-columns: 200px 1fr; gap: 30px; margin-bottom: 50px; }
.poster-container img { width: 100%; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.4); }
.details-container h1 { font-size: 2.2rem; margin: 0 0 10px 0; line-height: 1.1; }
.metadata { display: flex; align-items: center; gap: 15px; color: var(--text-muted); font-weight: 600; margin-bottom: 20px; font-size: 0.9rem; }
.rating { color: #46d369; font-weight: bold; }
.year, .quality { border: 1px solid #444; padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; }
.genres { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.genre-tag { background: rgba(255,255,255,0.1); padding: 4px 10px; border-radius: 4px; font-size: 0.8rem; color: #ddd; }
.overview { line-height: 1.6; color: #ccc; font-size: 1rem; }

@media (max-width: 768px) {
    .movie-info { grid-template-columns: 1fr; }
    .poster-container { display: none; }
    .details-container h1 { font-size: 1.5rem; }
}

/* --- FOOTER --- */
.sk-footer { background-color: #111; padding: 60px 4% 40px; margin-top: 80px; border-top: 1px solid #222; font-family: 'Saira', sans-serif; color: #fff; font-size: 0.9rem; }
.sk-footer-top { display: flex; justify-content: space-between; align-items: center; padding-bottom: 50px; border-bottom: 1px solid #2a2a2a; margin-bottom: 50px; flex-wrap: wrap; gap: 30px; }
.sk-top-left h2 { font-size: 1.8rem; font-weight: 700; line-height: 1.2; margin-bottom: 5px; }
.sk-top-right { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.sk-app-icon { width: 50px; height: 50px; background: #e50914; color: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.2rem; flex-shrink: 0; }
.sk-dl-group { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sk-store-link { display: inline-block; transition: 0.3s; height: 42px; }
.sk-store-img { height: 100%; width: auto; display: block; cursor: pointer; }
.sk-store-link:hover { transform: translateY(-2px); opacity: 0.9; }
.sk-footer-grid { display: grid; grid-template-columns: repeat(4, 1fr) 1.2fr; gap: 30px; padding-bottom: 50px; border-bottom: 1px solid #2a2a2a; }
.sk-col { display: flex; flex-direction: column; gap: 15px; }
.sk-head-xs { font-size: 0.8rem; color: #888; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin-bottom: 5px; }
.sk-li { color: #ccc; font-size: 0.9rem; text-decoration: none; transition: 0.2s; }
.sk-li:hover { color: #e50914; }
.sk-chat-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px; border: 1px solid #fff; background: transparent; color: #fff; font-weight: 700; text-transform: uppercase; border-radius: 4px; cursor: pointer; transition: 0.3s; margin-top: 5px; width: fit-content; }
.sk-chat-btn:hover { background: white; color: black; }
.sk-brand-row { display: flex; justify-content: space-between; align-items: center; padding-top: 40px; margin-bottom: 40px; flex-wrap: wrap; gap: 20px; }
.sk-logo-big { font-size: 1.8rem; font-weight: 800; color: #e50914; letter-spacing: 1px; text-transform: uppercase; }
.sk-social-group { display: flex; align-items: center; gap: 20px; }
.sk-keep-touch { font-size: 0.8rem; font-weight: 700; color: #888; text-transform: uppercase; margin-right: 10px; }
.sk-soc-icon { color: #ccc; transition: 0.3s; }
.sk-soc-icon:hover { color: #e50914; transform: translateY(-2px); }
.sk-bottom-info { display: grid; grid-template-columns: 1fr 2fr; gap: 50px; color: #888; font-size: 0.85rem; line-height: 1.6; }
.sk-office-title { font-size: 0.8rem; font-weight: 700; color: #888; text-transform: uppercase; margin-bottom: 10px; }

@media (max-width: 900px) {
    .sk-footer-grid { grid-template-columns: 1fr 1fr; gap: 40px 20px; }
    .sk-bottom-info { grid-template-columns: 1fr; gap: 30px; }
    .sk-top-left h2 { font-size: 1.4rem; }
}
@media (max-width: 480px) {
    .sk-footer-top, .sk-top-right, .sk-brand-row { flex-direction: column; align-items: flex-start; }
    .sk-dl-group { width: 100%; justify-content: flex-start; }
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}