:root {
    --primary: #0099ff; 
    --bg: #111111;
    --surface: #1e1e1e;
    --text: #ffffff;
    --text-muted: #aaaaaa;
}

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

body { font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background-color: var(--bg); color: var(--text); line-height: 1.6; padding-bottom: 20px;}

header { background: rgba(17, 17, 17, 0.95); backdrop-filter: blur(10px); padding: 15px 5%; position: sticky; top: 0; z-index: 100; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; border-bottom: 1px solid #222; }
.logo { font-size: 20px; font-weight: 800; color: white; cursor: pointer; text-decoration: none; margin-right: auto;}
.logo span { color: var(--primary); }

.profile-menu { margin-left: 15px; position: relative; display: inline-block; }
.avatar-icon { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--primary); object-fit: cover; cursor: pointer; background-color: #222; }
.dropdown-content { display: none; position: absolute; right: 0; top: 55px; background-color: var(--surface); min-width: 180px; box-shadow: 0px 8px 16px rgba(0,0,0,0.8); border-radius: 12px; border: 1px solid #333; z-index: 200; overflow: hidden;}
.dropdown-content a { color: white; padding: 12px 16px; text-decoration: none; display: block; font-size: 14px; border-bottom: 1px solid #222; cursor: pointer;}
.dropdown-content a:hover { background-color: #2a2a2a; }
.show-dropdown { display: block; }

.search-box { display: flex; gap: 8px; width: 100%; margin-top: 15px; order: 3; }
input { flex: 1; padding: 10px 15px; border-radius: 12px; border: none; background: #2a2a2a; color: white; outline: none; font-size: 14px;}
input:focus { border: 1px solid var(--primary); }
button { padding: 10px 15px; border-radius: 12px; border: none; background: var(--primary); color: white; font-weight: bold; cursor: pointer; font-size: 14px;}
button:hover { opacity: 0.8; }

@media (min-width: 600px) {
    header { flex-wrap: nowrap; }
    .search-box { width: auto; flex: 1; margin: 0 20px; margin-top: 0; order: unset; }
}

.container { padding: 20px 5%; min-height: 70vh; }
.section-title { font-size: 18px; margin-bottom: 15px; font-weight: bold; }

.filter-container { display: flex; overflow-x: auto; gap: 10px; margin-bottom: 20px; padding-bottom: 5px; scrollbar-width: none; }
.filter-container::-webkit-scrollbar { display: none; }
.filter-btn { padding: 8px 16px; border-radius: 20px; background: #222; border: 1px solid #333; color: var(--text-muted); font-size: 13px; white-space: nowrap; cursor: pointer; transition: 0.2s; }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); font-weight: bold;}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 12px; }

.card { background: var(--surface); border-radius: 12px; overflow: hidden; cursor: pointer; position: relative; aspect-ratio: 2 / 3; transition: transform 0.2s; }
.card:active { transform: scale(0.95); }
.card img { width: 100%; height: 100%; object-fit: cover; }
.card-info { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, transparent 100%); padding: 30px 10px 10px 10px; }
.card-title { font-size: 12px; font-weight: bold; line-height: 1.3; color: white; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 1px 1px 3px rgba(0,0,0,0.8); }
.card-badge { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); padding: 3px 6px; border-radius: 6px; font-size: 10px; font-weight: bold; display: flex; align-items: center; gap: 4px; border: 1px solid rgba(255,255,255,0.1);}
.badge-icon { color: #f5c518; }

#detailDrama { background: var(--surface); padding: 20px; border-radius: 16px; margin-bottom: 20px; }
.detail-title { font-size: 22px; margin-bottom: 10px; color: var(--primary); }
.detail-synopsis { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }

.episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.ep-btn { background: #333; border-radius: 8px; padding: 10px; text-align: center; font-size: 13px; }
.ep-btn:hover { background: var(--primary); color: white; }

#video-container { margin-bottom: 20px; }
.video-wrapper { width: 100%; background: black; border-radius: 12px; overflow: hidden; position: relative; padding-bottom: 56.25%; height: 0; }
.video-wrapper video, .video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 12px; display: block; }

.now-playing { text-align: center; margin-bottom: 10px; font-size: 16px; color: var(--text-muted); }
.player-controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 15px; }
.quality-btn { padding: 8px 12px; border-radius: 8px; background: #222; border: 1px solid #444; color: white; font-size: 12px; cursor: pointer; transition: 0.2s; }
.quality-btn.active { background: var(--primary); border-color: var(--primary); font-weight: bold; }
.vlc-btn { padding: 8px 15px; border-radius: 8px; background: #ff8800; color: white; border: none; font-size: 12px; font-weight: bold; cursor: pointer; display: flex; align-items: center; gap: 5px; box-shadow: 0 4px 10px rgba(255, 136, 0, 0.3); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 30px; }
.pagination button { background: #222; padding: 8px 15px; border-radius: 12px; border: 1px solid #333; color: white;}
.pagination button:hover { background: var(--primary); border-color: var(--primary);}
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.page-num { font-weight: bold; font-size: 14px; }

footer { text-align: center; padding: 30px 20px; border-top: 1px solid #222; margin-top: 40px; background: var(--bg); }
footer p { color: var(--text-muted); font-size: 14px; margin-bottom: 10px; }
.ig-link { display: inline-block; color: var(--primary); text-decoration: none; font-size: 14px; font-weight: bold; padding: 8px 16px; border: 1px solid var(--primary); border-radius: 20px; transition: 0.3s; }
.ig-link:hover { background: var(--primary); color: white; }

.toast { visibility: hidden; min-width: 250px; margin-left: -125px; background-color: #e63946; color: #fff; text-align: center; border-radius: 8px; padding: 12px 16px; position: fixed; z-index: 99999; left: 50%; bottom: 20px; font-size: 13px; font-weight: bold; box-shadow: 0px 5px 15px rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.3s, bottom 0.3s; }
.toast.show { visibility: visible; opacity: 1; bottom: 40px; }

.auth-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); backdrop-filter: blur(10px); z-index: 9000; display: flex; justify-content: center; align-items: center; padding: 20px; }
.auth-box { background: var(--surface); padding: 30px; border-radius: 20px; width: 100%; max-width: 350px; border: 1px solid #333; box-shadow: 0 10px 40px rgba(0,0,0,0.8); text-align: center;}
.auth-tabs { display: flex; justify-content: center; margin-bottom: 25px; background: #111; border-radius: 15px; padding: 5px; }
.auth-tab { flex: 1; background: transparent; border: none; color: #888; padding: 10px; border-radius: 12px; font-weight: bold; transition: 0.3s; font-size: 14px; }
.auth-tab.active { background: #2a2a2a; color: white; }
.auth-title { font-size: 22px; color: var(--primary); margin-bottom: 10px; font-weight: 800;}
.auth-desc { font-size: 13px; color: #aaa; margin-bottom: 20px; line-height: 1.4; }
.auth-input { width: 100%; margin-bottom: 15px; background: #1a1a1a; border: 1px solid #333; border-radius: 12px; padding: 12px 15px; color: white; font-size: 14px; }
.auth-input:focus { border-color: var(--primary); outline: none; }
.auth-btn { width: 100%; padding: 14px; border-radius: 12px; border: none; background: var(--primary); color: white; font-weight: bold; font-size: 15px; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 15px rgba(0, 153, 255, 0.3);}
.auth-btn:active { transform: scale(0.95); }
.credential-box { background: #111; border: 1px dashed #444; padding: 15px; border-radius: 10px; margin-bottom: 15px; text-align: left; font-size: 14px; }
.btn-download { background: #198754; box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3); }

.modal-window { display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.9); backdrop-filter: blur(5px); justify-content: center; align-items: center;}
.modal-box { background-color: var(--surface); margin: auto; padding: 25px; border: 1px solid #444; width: 90%; max-width: 400px; border-radius: 16px; position: relative; }
.history-box { max-width: 600px; max-height: 80vh; display: flex; flex-direction: column; }
.close-btn { color: #aaa; position: absolute; top: 15px; right: 20px; font-size: 24px; font-weight: bold; cursor: pointer; }
.close-btn:hover { color: white; }
.avatar-large { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid #555; background-color: #222; }

.history-list { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.history-card { display: flex; background: #111; border-radius: 10px; overflow: hidden; border: 1px solid #333; align-items: center; position: relative;}
.history-img { width: 80px; height: 100px; object-fit: cover; }
.history-info { padding: 10px; flex: 1; padding-right: 40px; } 
.history-title { font-size: 14px; font-weight: bold; color: var(--primary); margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;}
.history-ep { font-size: 12px; color: #ccc; }
.history-time { font-size: 11px; color: #888; margin-top: 5px; }
.progress-bar-bg { width: 100%; height: 4px; background: #333; margin-top: 8px; border-radius: 2px;}
.progress-bar-fill { height: 100%; background: var(--primary); border-radius: 2px;}

.btn-hapus-histori { position: absolute; right: 10px; top: 10px; background: transparent; color: #ff4d4d; border: none; font-size: 18px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 8px; transition: 0.2s; }
.btn-hapus-histori:hover { background: rgba(255, 77, 77, 0.2); }
.btn-lanjut-nonton { background: var(--primary); border: none; border-radius: 5px; color: white; padding: 5px 10px; font-size: 11px; cursor: pointer; margin-top: 5px; font-weight: bold;}

