/* ── Base ──────────────────────────────────────────────────── */
[x-cloak] { display: none !important; }
body { background:#0d0d0d; color:#e5e7eb; padding-bottom:64px; }
@media(min-width:1024px){ body { padding-bottom:0; } }

/* ── Nav Links ─────────────────────────────────────────────── */
.nav-link { padding:.4rem .75rem; border-radius:.5rem; color:#9ca3af; transition:all .15s; }
.nav-link:hover { color:#fff; background:#1a1a1a; }
.dd-item { display:block; padding:.6rem 1rem; color:#9ca3af; font-size:.875rem; transition:all .15s; }
.dd-item:hover { color:#fff; background:#1f1f1f; }
.mobile-nav-link { display:block; padding:.65rem 1rem; border-radius:.75rem; color:#9ca3af; font-size:.9rem; transition:all .15s; }
.mobile-nav-link:hover { color:#fff; background:#1a1a1a; }
.bottom-nav-item { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.2rem; padding:.6rem .25rem; color:#6b7280; font-size:.65rem; transition:color .15s; }
.bottom-nav-item:hover,.bottom-nav-item.active { color:#7c3aed; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary { display:inline-flex; align-items:center; justify-content:center; gap:.4rem; padding:.45rem 1.1rem; background:#7c3aed; color:#fff; border-radius:9999px; font-weight:600; font-size:.875rem; transition:all .2s; border:none; cursor:pointer; }
.btn-primary:hover { background:#6d28d9; transform:translateY(-1px); box-shadow:0 4px 20px rgba(124,58,237,.4); }
.btn-ghost { display:inline-flex; align-items:center; justify-content:center; gap:.4rem; padding:.45rem 1.1rem; background:transparent; color:#9ca3af; border-radius:9999px; font-weight:500; font-size:.875rem; border:1px solid #1f1f1f; transition:all .2s; cursor:pointer; }
.btn-ghost:hover { color:#fff; border-color:#374151; background:#1a1a1a; }
.btn-accent { display:inline-flex; align-items:center; gap:.4rem; padding:.45rem 1.1rem; background:#06b6d4; color:#fff; border-radius:9999px; font-weight:600; font-size:.875rem; transition:all .2s; }
.btn-accent:hover { background:#0891b2; transform:translateY(-1px); }
.btn-danger { display:inline-flex; align-items:center; gap:.4rem; padding:.4rem 1rem; background:#dc2626; color:#fff; border-radius:.5rem; font-size:.875rem; transition:all .15s; }
.btn-danger:hover { background:#b91c1c; }
.icon-btn { padding:.4rem; border-radius:.5rem; color:#9ca3af; transition:all .15s; background:transparent; border:none; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; }
.icon-btn:hover { color:#fff; background:#1a1a1a; }

/* ── Cards ─────────────────────────────────────────────────── */
.anime-card { background:#111; border:1px solid #1f1f1f; border-radius:1rem; overflow:hidden; transition:all .25s; position:relative; }
.anime-card:hover { border-color:#7c3aed; transform:translateY(-4px); box-shadow:0 12px 40px rgba(124,58,237,.25); }
.anime-card .card-img { width:100%; aspect-ratio:2/3; object-fit:cover; display:block; transition:transform .35s; }
.anime-card:hover .card-img { transform:scale(1.05); }
.anime-card .card-overlay { position:absolute; bottom:0; left:0; right:0; background:linear-gradient(to top,rgba(0,0,0,.95) 0%,transparent 60%); padding:1rem .75rem .75rem; }
.card-badge { display:inline-block; padding:.2rem .5rem; border-radius:.35rem; font-size:.65rem; font-weight:700; text-transform:uppercase; }
.badge-ongoing  { background:rgba(16,185,129,.2); color:#34d399; }
.badge-completed{ background:rgba(59,130,246,.2); color:#60a5fa; }
.badge-movie    { background:rgba(245,158,11,.2); color:#fbbf24; }
.badge-default  { background:rgba(107,114,128,.2); color:#9ca3af; }

/* ── Sections ──────────────────────────────────────────────── */
.section-title { font-family:'Space Grotesk',sans-serif; font-size:1.25rem; font-weight:700; color:#f3f4f6; display:flex; align-items:center; gap:.5rem; margin-bottom:1rem; }
.section-title::before { content:''; display:block; width:4px; height:1.25rem; background:linear-gradient(to bottom,#7c3aed,#06b6d4); border-radius:9999px; }
.section-link { font-size:.8rem; color:#7c3aed; font-weight:500; margin-left:auto; }
.section-link:hover { color:#8b5cf6; }

/* ── Input / Form ──────────────────────────────────────────── */
.input-field { background:#111; border:1px solid #1f1f1f; color:#e5e7eb; border-radius:.75rem; padding:.6rem 1rem; font-size:.875rem; outline:none; transition:border-color .2s; width:100%; }
.input-field:focus { border-color:#7c3aed; box-shadow:0 0 0 3px rgba(124,58,237,.15); }
.input-field::placeholder { color:#4b5563; }
.form-label { display:block; font-size:.875rem; font-weight:500; color:#9ca3af; margin-bottom:.4rem; }
.form-error { font-size:.8rem; color:#f87171; margin-top:.25rem; }
.select-field { background:#111; border:1px solid #1f1f1f; color:#e5e7eb; border-radius:.75rem; padding:.6rem 1rem; font-size:.875rem; outline:none; }
.select-field:focus { border-color:#7c3aed; }

/* ── Hero ──────────────────────────────────────────────────── */
.hero-slide { position:relative; min-height:70vh; display:flex; align-items:flex-end; overflow:hidden; }
.hero-bg { position:absolute; inset:0; object-fit:cover; width:100%; height:100%; filter:brightness(.5) saturate(1.05); }
.hero-gradient { position:absolute; inset:0; background:linear-gradient(100deg,rgba(0,0,0,.92) 22%,rgba(0,0,0,.55) 55%,rgba(0,0,0,.15) 85%), linear-gradient(to top,rgba(0,0,0,.95) 0%,rgba(0,0,0,.35) 45%,transparent 75%); }
.hero-content { position:relative; z-index:1; max-width:560px; padding:2rem; }

/* ── Player ─────────────────────────────────────────────────── */
.player-container { position:relative; background:#000; border-radius:.75rem; overflow:hidden; }
.player-iframe { width:100%; aspect-ratio:16/9; border:none; display:block; }
.server-btn { padding:.45rem 1rem; border-radius:.5rem; background:#1a1a1a; border:1px solid #1f1f1f; color:#9ca3af; font-size:.8rem; cursor:pointer; transition:all .15s; }
.server-btn:hover,.server-btn.active { background:#7c3aed; border-color:#7c3aed; color:#fff; }

/* ── Tags / Badges ─────────────────────────────────────────── */
.genre-tag { display:inline-block; padding:.2rem .6rem; background:#1a1a1a; border:1px solid #1f1f1f; color:#9ca3af; border-radius:9999px; font-size:.7rem; transition:all .15s; }
.genre-tag:hover { background:#7c3aed22; border-color:#7c3aed; color:#8b5cf6; }
.status-badge { padding:.25rem .7rem; border-radius:9999px; font-size:.7rem; font-weight:600; text-transform:uppercase; }

/* ── Skeleton Loading ──────────────────────────────────────── */
.skeleton { background:linear-gradient(90deg,#1a1a1a 25%,#222 50%,#1a1a1a 75%); background-size:200% 100%; animation:shimmer 1.5s infinite; border-radius:.5rem; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Comic Reader ──────────────────────────────────────────── */
.reader-page { max-width:800px; width:100%; margin:0 auto; display:block; }
.reader-page img { width:100%; display:block; }

/* ── Glassmorphism ─────────────────────────────────────────── */
.glass { background:rgba(255,255,255,.04); backdrop-filter:blur(12px); border:1px solid rgba(255,255,255,.08); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:#0d0d0d; }
::-webkit-scrollbar-thumb { background:#374151; border-radius:9999px; }
::-webkit-scrollbar-thumb:hover { background:#4b5563; }

/* ── Utilities ─────────────────────────────────────────────── */
.line-clamp-1 { overflow:hidden; display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; }
.line-clamp-2 { overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.line-clamp-3 { overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; }
.container-main { max-width:1536px; margin:0 auto; padding:0 1rem; }

/* ── Star Rating ────────────────────────────────────────────── */
.stars { color:#fbbf24; letter-spacing:.05rem; }

/* ============================================================
   LIGHT MODE
   Situs ini awalnya didesain dark-only (semua warna di-hardcode
   gelap), jadi tombol toggle tema tidak kelihatan efeknya sama
   sekali. Blok di bawah ini mengaktifkan tampilan terang yang
   nyata ketika mode dark dimatikan (html tanpa class `.dark`).
   ============================================================ */
html:not(.dark) body { background:#f7f7f8; color:#18181b; }

html:not(.dark) .bg-dark,
html:not(.dark) .bg-dark-card { background-color:#ffffff !important; }
html:not(.dark) .bg-dark-hover,
html:not(.dark) .hover\:bg-dark-hover:hover { background-color:#f1f1f3 !important; }
html:not(.dark) .border-dark-border,
html:not(.dark) .border-dark { border-color:#e4e4e7 !important; }

html:not(.dark) .text-white { color:#18181b !important; }
html:not(.dark) .text-gray-100 { color:#18181b !important; }
html:not(.dark) .text-gray-200,
html:not(.dark) .text-gray-300 { color:#27272a !important; }
html:not(.dark) .text-gray-400,
html:not(.dark) .text-gray-500 { color:#52525b !important; }
html:not(.dark) .text-gray-600,
html:not(.dark) .text-gray-700 { color:#71717a !important; }
html:not(.dark) .text-gray-800,
html:not(.dark) .text-gray-900 { color:#3f3f46 !important; }

/* Pengecualian: teks yang selalu berada di atas permukaan gelap (hero
   banner dengan overlay gelap, notifikasi toast sukses/error) harus
   tetap putih di kedua mode — kalau ikut di-override jadi gelap, teksnya
   jadi tidak kebaca karena latar belakangnya tetap gelap. */
html:not(.dark) .hero-content .text-white,
html:not(.dark) .hero-content .text-gray-300,
html:not(.dark) .hero-content .text-gray-400,
html:not(.dark) .hero-content .text-gray-500,
html:not(.dark) .toast-white { color:#ffffff !important; }
html:not(.dark) .hero-content .text-gray-300 { color:#e4e4e7 !important; }
html:not(.dark) .hero-content .genre-tag { background:rgba(255,255,255,.1) !important; border-color:rgba(255,255,255,.18) !important; color:#e4e4e7 !important; }
html:not(.dark) .hero-content .genre-tag:hover { background:rgba(124,58,237,.25) !important; border-color:#7c3aed !important; color:#fff !important; }

html:not(.dark) .nav-link { color:#52525b; }
html:not(.dark) .nav-link:hover { color:#18181b; background:#f1f1f3; }
html:not(.dark) .dd-item { color:#52525b; }
html:not(.dark) .dd-item:hover { color:#18181b; background:#f1f1f3; }
html:not(.dark) .mobile-nav-link { color:#52525b; }
html:not(.dark) .mobile-nav-link:hover { color:#18181b; background:#f1f1f3; }
html:not(.dark) .bottom-nav-item { color:#71717a; }

html:not(.dark) .btn-ghost { color:#52525b; border-color:#e4e4e7; }
html:not(.dark) .btn-ghost:hover { color:#18181b; border-color:#d4d4d8; background:#f1f1f3; }
html:not(.dark) .icon-btn { color:#52525b; }
html:not(.dark) .icon-btn:hover { color:#18181b; background:#f1f1f3; }

html:not(.dark) .anime-card { background:#ffffff; border-color:#e4e4e7; box-shadow:0 1px 3px rgba(0,0,0,.06); }
html:not(.dark) .section-title { color:#18181b; }

html:not(.dark) .input-field,
html:not(.dark) .select-field { background:#ffffff; border-color:#d4d4d8; color:#18181b; }
html:not(.dark) .input-field::placeholder { color:#a1a1aa; }
html:not(.dark) .form-label { color:#52525b; }

html:not(.dark) .server-btn { background:#f1f1f3; border-color:#e4e4e7; color:#52525b; }
html:not(.dark) .genre-tag { background:#f1f1f3; border-color:#e4e4e7; color:#52525b; }

html:not(.dark) .skeleton { background:linear-gradient(90deg,#e4e4e7 25%,#f1f1f3 50%,#e4e4e7 75%); background-size:200% 100%; }
html:not(.dark) .glass { background:rgba(0,0,0,.03); border-color:rgba(0,0,0,.08); }

html:not(.dark) .page-link { background:#ffffff; border-color:#e4e4e7; color:#52525b; }
html:not(.dark) .page-link:hover,
html:not(.dark) .page-link.active { background:#7c3aed; border-color:#7c3aed; color:#fff; }

html:not(.dark) header.sticky { background:rgba(255,255,255,.95); }
html:not(.dark) footer { background:#ffffff; }
html:not(.dark) ::-webkit-scrollbar-track { background:#f1f1f3; }

/* ── Pagination ─────────────────────────────────────────────── */
.page-link { display:inline-flex; align-items:center; justify-content:center; width:2.25rem; height:2.25rem; border-radius:.5rem; background:#111; border:1px solid #1f1f1f; color:#9ca3af; font-size:.875rem; transition:all .15s; }
.page-link:hover,.page-link.active { background:#7c3aed; border-color:#7c3aed; color:#fff; }
.page-link.disabled { opacity:.4; pointer-events:none; }

/* ── Anime Title List (katalog A-Z, tanpa card) ────────────────── */
.anime-title-list { display:grid; grid-template-columns:repeat(2,1fr); gap:.5rem .75rem; }
@media(min-width:640px)  { .anime-title-list { grid-template-columns:repeat(3,1fr); } }
@media(min-width:1024px) { .anime-title-list { grid-template-columns:repeat(4,1fr); } }
.anime-title-item { display:block; padding:.65rem 1rem; background:#111; border:1px solid #1f1f1f; border-radius:.6rem; color:#d1d5db; font-size:.85rem; line-height:1.3; transition:all .15s; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.anime-title-item:hover { color:#fff; border-color:#7c3aed; background:#1a1a1a; }
html:not(.dark) .anime-title-item { background:#ffffff; border-color:#e4e4e7; color:#3f3f46; }
html:not(.dark) .anime-title-item:hover { color:#18181b; border-color:#7c3aed; background:#f1f1f3; }

/* ── Responsive Grid ─────────────────────────────────────────── */
.anime-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:.75rem; }
@media(min-width:640px)  { .anime-grid { grid-template-columns:repeat(3,1fr); } }
@media(min-width:768px)  { .anime-grid { grid-template-columns:repeat(4,1fr); } }
@media(min-width:1024px) { .anime-grid { grid-template-columns:repeat(5,1fr); gap:1rem; } }
@media(min-width:1280px) { .anime-grid { grid-template-columns:repeat(6,1fr); } }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.fade-in { animation:fadeIn .3s ease forwards; }
@keyframes pulse-slow { 0%,100%{opacity:1} 50%{opacity:.6} }
.pulse-slow { animation:pulse-slow 2s infinite; }
