/* MANGATRENDINDO — gaya Voratoon: gelap + oranye */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0A0E17;
  --card: #111827;
  --card-2: #1A2436;
  --text: #E5E7EB;
  --muted: #9CA3AF;
  --accent: #FF7A00;
  --accent-2: #FF9A3D;
  --green: #22C55E;
  --border: #1F2937;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  background: #0A0E17F2;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.logo { font-size: 22px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 14px;
  color: var(--muted);
}
.nav a:hover, .nav a.active { color: #fff; background: var(--card); }
.search-box { margin-left: auto; flex: 1 1 160px; max-width: 320px; }
.search-box input {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 14px; outline: none;
}
.search-box input:focus { border-color: var(--accent); }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.section-title {
  font-size: 20px; font-weight: 800; margin: 28px 0 14px;
  padding-left: 10px; border-left: 4px solid var(--accent);
}
.section-title:first-child { margin-top: 4px; }
.section-sub { color: var(--muted); font-size: 14px; margin: -6px 0 14px; }
.loading, .empty { color: var(--muted); padding: 30px 0; text-align: center; }

/* Grid postingan ala Voratoon: 2 kolom di HP */
.manga-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
@media (min-width: 640px) { .manga-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .manga-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }

.manga-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; display: block;
  transition: transform .15s ease, border-color .15s ease;
}
.manga-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.manga-card img {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: #1A2436;
}
.manga-card-body { padding: 10px 12px 12px; }
.manga-card h3 { font-size: 15px; line-height: 1.3; margin-bottom: 6px; }
.manga-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; background: var(--card-2); color: var(--muted);
}
.badge.hot { background: var(--accent); color: #fff; }
.badge.new { background: var(--green); color: #fff; }
.badge.status { background: #1E3A5F; color: #93C5FD; }
.rating { color: #FBBF24; font-weight: 700; }

/* Update Terbaru — daftar chapter */
.update-list { display: flex; flex-direction: column; gap: 10px; }
.update-item {
  display: flex; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px;
}
.update-item img { width: 56px; height: 84px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.update-item h3 { font-size: 15px; }
.update-item h3 a:hover { color: var(--accent); }
.update-item .chapter-links { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.update-item .chapter-link {
  display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 600;
  color: var(--accent-2);
}
.update-item .chapter-link:hover { text-decoration: underline; }
.update-time { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.up-label { color: var(--green); font-weight: 700; font-size: 12px; }

/* Genre filter */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 13px; font-weight: 600;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Detail manga */
.detail { display: flex; gap: 20px; flex-wrap: wrap; }
.detail-cover { width: 180px; flex-shrink: 0; }
.detail-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; }
.detail-info { flex: 1 1 300px; }
.detail-info h1 { font-size: 26px; margin-bottom: 8px; }
.detail-info .sinopsis { color: var(--muted); margin: 12px 0 16px; max-width: 640px; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
  border: none;
}
.btn:hover { background: #E66E00; }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { border-color: var(--accent); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.progress-note { font-size: 13px; color: var(--muted); margin-top: 8px; }

.chapter-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.chapter-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.chapter-row:hover { border-color: var(--accent); }
.chapter-row .ch-num { font-weight: 800; color: var(--accent); white-space: nowrap; }
.chapter-row .ch-title { flex: 1; font-weight: 600; font-size: 14px; }
.chapter-row time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.chapter-row .ch-views { font-size: 12px; color: var(--muted); white-space: nowrap; }
.read-badge { font-size: 11px; font-weight: 700; color: var(--green); }
.komentar { margin-top: 28px; }
.komentar .section-title { margin-bottom: 8px; }
#disqus_thread { min-height: 120px; }
.chapter-row-wrap { display: flex; gap: 8px; align-items: stretch; }
.chapter-row-wrap .chapter-row { flex: 1; min-width: 0; }
.btn-dl {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--card); border: 1px solid var(--border); color: var(--accent);
  border-radius: 10px; padding: 0 14px; font-size: 13px; font-weight: 800; white-space: nowrap;
  text-decoration: none;
}
.btn-dl:hover { border-color: var(--accent); }

/* Reader vertikal */
.reader { max-width: 800px; margin: 0 auto; }
.reader-head { text-align: center; margin-bottom: 16px; }
.reader-head h1 { font-size: 20px; }
.reader-head p { color: var(--muted); font-size: 14px; }
.reader-nav {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0;
}
.reader-nav .btn { flex: 1 1 120px; text-align: center; max-width: 220px; }
.reader-pages img { width: 100%; margin-bottom: 0; background: #1A2436; }
.reader-pages img + img { margin-top: 0; }

/* Footer */
.footer {
  border-top: 1px solid var(--border); padding: 24px 16px 32px;
  text-align: center; color: var(--muted); font-size: 13px;
}
.footer p { margin-bottom: 6px; }
.footer-copy { font-size: 12px; }

@media (max-width: 480px) {
  .logo { font-size: 19px; }
  .detail-cover { width: 130px; }
  .detail-info h1 { font-size: 21px; }
  .update-time { display: none; }
}

/* Slot iklan */
.ad-slot { text-align: center; margin: 12px auto; max-width: 100%; overflow: hidden; }
.ad-slot iframe { max-width: 100%; }

.ad-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 12px; }
.ad-row .ad-item { max-width: 100%; overflow: hidden; }

/* Layout dua kolom + sidebar */
.layout { display: flex; gap: 24px; align-items: flex-start; }
.layout .content { flex: 1 1 auto; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px; padding-top: 4px; }
.side-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.side-box h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; padding-left: 8px; border-left: 3px solid var(--accent); }
.side-rank { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.side-rank:last-child { border-bottom: none; }
.side-rank .rank { font-weight: 800; color: var(--accent); width: 18px; flex-shrink: 0; }
.side-rank img { width: 40px; height: 60px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.side-rank .side-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.side-rank .side-title:hover { color: var(--accent); }
.side-rank .side-ch { font-size: 12px; color: var(--muted); }
.sidebar .chips { margin-bottom: 0; }

/* Tombol kembali ke atas */
#to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--accent); color: #fff; font-size: 20px; font-weight: 800;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
#to-top.show { opacity: 1; pointer-events: auto; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
}

/* ---------- Chapter VIP (terkunci) ---------- */
.vip-badge { background: #FFD700; color: #111; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chapter-row.vip-row { opacity: .95; }
.vip-lock { max-width: 560px; margin: 48px auto; text-align: center; padding: 32px 20px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
.vip-lock-icon { font-size: 56px; }
.vip-lock h1 { font-size: 22px; margin: 12px 0 4px; }
.vip-lock-sub { color: var(--muted); font-size: 14px; }
.vip-lock p { color: var(--muted); line-height: 1.6; }
.vip-lock .btn { display: inline-block; margin: 10px 6px 0; }

/* ---------- Update Terbaru ala VoraToon: grid 2 kolom ---------- */
.update-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.update-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.update-chapters { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.update-ch-link { display: flex; justify-content: space-between; align-items: center; gap: 6px; background: var(--card-2); border-radius: 8px; padding: 7px 8px; color: var(--text); font-weight: 700; font-size: 12px; }
.update-ch-link:hover { text-decoration: underline; }
.update-ch-link > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.update-ch-link .up-badge { color: var(--green); font-weight: 800; font-size: 10px; margin-left: 4px; }
.update-ch-time { font-size: 11px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.update-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.update-card h3 { text-align: center; font-size: 15px; padding: 10px 8px 12px; margin: 0; }
.update-card h3 a { color: var(--text); }
.update-card h3 a:hover { color: var(--accent); }
@media (min-width: 900px) { .update-grid { grid-template-columns: repeat(4, 1fr); } }
.update-card .update-chapters { padding-top: 0; }
