/* SuperNovel - Main Stylesheet */
/* Mobile-first, responsive, clean design */

/* ===== DARK MODE (default) ===== */
:root,
[data-theme="dark"] {
  --primary: #6c3fc5;
  --primary-dark: #5a32a3;
  --primary-light: #8b5cf6;
  --accent: #f59e0b;
  --bg: #0f0f1a;
  --bg2: #1a1a2e;
  --bg3: #16213e;
  --card: #1e1e35;
  --card2: #252545;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --border: #2d2d50;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 6px rgba(0,0,0,0.3);
  --transition: 0.2s ease;
}

/* ===== LIGHT MODE ===== */
[data-theme="light"] {
  --bg: #f0f2f8;
  --bg2: #e4e8f5;
  --bg3: #dce1f0;
  --card: #ffffff;
  --card2: #f5f7fc;
  --text: #1a1a2e;
  --text2: #3a4060;
  --text3: #7a829e;
  --border: #d0d5e8;
  --shadow: 0 4px 6px rgba(0,0,0,0.08);
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  padding: 7px 11px;
  line-height: 1;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
  title: "Toggle tema";
}
.theme-toggle:hover { background: var(--border); }

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* Smooth theme transition */
body { transition: background-color 0.25s ease, color 0.15s ease; }

a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===================== HEADER ===================== */
.site-header {
  background: var(--bg3);
  border-bottom: 2px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  flex-wrap: nowrap;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
  white-space: nowrap;
}

.logo-icon { font-size: 1.5rem; }
.logo-text { color: var(--primary-light); }

.search-form {
  flex: 1;
  display: flex;
  max-width: 400px;
}

.search-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.search-form input:focus { border-color: var(--primary); }

.search-form button {
  padding: 8px 14px;
  background: var(--primary);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: 16px;
  transition: background var(--transition);
}

.search-form button:hover { background: var(--primary-dark); }

.main-nav { position: relative; }

.nav-toggle {
  display: none;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 18px;
}

.main-nav > ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.main-nav > ul > li { position: relative; }

.main-nav > ul > li > a {
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  display: block;
  font-size: 14px;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.main-nav > ul > li > a:hover { background: var(--card2); color: var(--primary-light); }

.dropdown {
  display: none !important;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 170px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 9999;
  flex-direction: column !important;
  gap: 0 !important;
  animation: dropIn 0.15s ease;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.has-dropdown.open .dropdown { display: flex !important; }

.dropdown li a { padding: 10px 16px; border-radius: 0; font-size: 14px; }
.dropdown li:first-child a { border-radius: var(--radius) var(--radius) 0 0; }
.dropdown li:last-child a { border-radius: 0 0 var(--radius) var(--radius); }

.btn-login, .btn-register {
  padding: 7px 14px !important;
  border-radius: var(--radius) !important;
  font-weight: 600 !important;
}

.btn-login { background: var(--card2) !important; }
.btn-register { background: var(--primary) !important; color: #fff !important; }
.btn-register:hover { background: var(--primary-dark) !important; }

/* ===================== LAYOUT ===================== */
.site-body { padding: 20px 0; }

.layout-main {
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-areas: "main sidebar";
  gap: 24px;
  align-items: start;
}

.main-content { 
  grid-area: main;
  min-width: 0;
}

.sidebar { 
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.layout-full { display: block; }

/* ===================== CARDS ===================== */
.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.novel-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
}

.novel-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(108,63,197,0.3); }

.novel-card-cover {
  position: relative;
  padding-top: 140%;
  overflow: hidden;
}

.novel-card-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.novel-card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.novel-card-badge.completed { background: var(--success); }
.novel-card-badge.hiatus { background: var(--warning); color: #000; }

.novel-card-info { padding: 10px; }

.novel-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.novel-card-meta {
  font-size: 11px;
  color: var(--text3);
  display: flex;
  justify-content: space-between;
}

/* ===================== SECTION TITLES ===================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

.see-all {
  font-size: 13px;
  color: var(--primary-light);
}

/* ===================== NOVEL DETAIL ===================== */
.novel-detail { margin-bottom: 24px; }

.novel-header {
  display: flex;
  gap: 20px;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
}

.novel-cover-wrap {
  flex-shrink: 0;
  width: 140px;
}

.novel-cover-wrap img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.novel-meta h1 {
  font-size: 1.4rem;
  line-height: 1.3;
  margin-bottom: 8px;
}

.novel-meta-item {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.novel-meta-item strong { color: var(--text); }

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-ongoing { background: rgba(59,130,246,0.2); color: var(--info); }
.status-completed { background: rgba(16,185,129,0.2); color: var(--success); }
.status-hiatus { background: rgba(245,158,11,0.2); color: var(--warning); }

.genre-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

.genre-tag {
  padding: 3px 10px;
  background: rgba(108,63,197,0.2);
  border: 1px solid var(--primary);
  border-radius: 20px;
  font-size: 12px;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

.genre-tag .badge {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.novel-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text2);
}

.stat-item strong { color: var(--text); font-size: 15px; }

.novel-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-align: center;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #000; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ===================== SYNOPSIS ===================== */
.novel-synopsis {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 16px 0;
  border: 1px solid var(--border);
}

.novel-synopsis h3 { margin-bottom: 12px; font-size: 1rem; color: var(--primary-light); }

.synopsis-text {
  color: var(--text2);
  line-height: 1.8;
  font-size: 14px;
}

/* ===================== CHAPTER LIST ===================== */
.chapter-list-wrap {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 16px 0;
}

.chapter-list-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chapter-list { list-style: none; max-height: 400px; overflow-y: auto; }

.chapter-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text2);
  transition: background var(--transition);
}

.chapter-list li a:hover { background: var(--card2); color: var(--primary-light); }
.chapter-list li:last-child a { border-bottom: none; }
.chapter-list li a span { font-size: 12px; color: var(--text3); }

/* ===================== CHAPTER READER ===================== */
.chapter-reader {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--card2);
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}

.chapter-nav h1 {
  font-size: 1rem;
  flex: 1;
  text-align: center;
  color: var(--text);
}

.chapter-content {
  padding: 24px 32px;
  font-size: 17px;
  line-height: 1.85;
  color: var(--text2);
  /* pre-wrap dihapus: biar PHP yang handle paragraph dengan <p> tags */
}

/* Setiap paragraf punya jarak bawah yang wajar */
.chapter-content p {
  margin-bottom: 1.2em;
  text-indent: 0;
}

/* Hapus margin dari paragraf terakhir */
.chapter-content p:last-child { margin-bottom: 0; }

.chapter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--card2);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.font-controls { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }

.font-btn {
  width: 30px;
  height: 30px;
  background: var(--border);
  border: none;
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================== AD BLOCKS ===================== */
.ad-block {
  display: block;
  text-align: center;
  margin: 20px auto;
  width: 100%;
  overflow: visible;
  /* Tanpa min-height agar tidak ada ruang kosong jika iklan tidak load */
}

/* AdSense: ins element */
.ad-block ins.adsbygoogle {
  display: block !important;
}

/* Adsterra iframe */
.ad-block iframe {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

/* Script tag tidak butuh tampil */
.ad-block script {
  display: none;
}

.ad-label {
  font-size: 10px;
  color: var(--text3);
  text-align: center;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===================== COMMENTS ===================== */
.comments-section {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  margin-top: 16px;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.comment-item:last-child { border-bottom: none; }

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  color: #fff;
}

.comment-author { font-size: 13px; font-weight: 600; color: var(--text); }
.comment-time { font-size: 11px; color: var(--text3); margin-left: 8px; }
.comment-text { font-size: 14px; color: var(--text2); margin-top: 4px; line-height: 1.6; }

.comment-reply {
  margin-left: 48px;
  border-left: 2px solid var(--primary);
  padding-left: 12px;
}

.comment-form textarea {
  width: 100%;
  min-height: 100px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  margin-bottom: 10px;
}

.comment-form textarea:focus { border-color: var(--primary); }

/* ===================== RATING ===================== */
.rating-stars { display: flex; gap: 4px; }

.star-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text3);
  padding: 2px;
  transition: color var(--transition), transform var(--transition);
}

.star-btn:hover, .star-btn.active { color: var(--accent); transform: scale(1.2); }

/* ===================== SIDEBAR ===================== */

.widget {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border);
}

.widget-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.widget-list { list-style: none; }

.widget-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.widget-item:last-child { border-bottom: none; }

.widget-item img {
  width: 40px;
  height: 55px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 16px;
  color: var(--text3);
}

.rank.rank-top { background: var(--accent); color: #000; }

.widget-info { flex: 1; min-width: 0; }

.widget-novel-title {
  font-size: 13px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.widget-views { font-size: 11px; color: var(--text3); }

/* ===================== BREADCRUMB ===================== */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 16px;
  align-items: center;
}

.breadcrumb ol li { display: flex; align-items: center; gap: 4px; }
.breadcrumb ol li:not(:last-child)::after { content: '/'; color: var(--text3); }
.breadcrumb ol li a { color: var(--primary-light); }
.breadcrumb ol li a:hover { color: var(--accent); }

/* ===================== PAGINATION ===================== */
.pagination { margin: 24px 0; }

.pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  justify-content: center;
}

.pagination ul li a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text2);
  transition: all var(--transition);
}

.pagination ul li a:hover,
.pagination ul li a.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.form-control:focus { border-color: var(--primary); }

select.form-control { cursor: pointer; }

textarea.form-control { min-height: 120px; resize: vertical; }

.form-hint { font-size: 12px; color: var(--text3); margin-top: 4px; }

/* ===================== ALERTS ===================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success { background: rgba(16,185,129,0.15); border: 1px solid var(--success); color: var(--success); }
.alert-danger { background: rgba(239,68,68,0.15); border: 1px solid var(--danger); color: var(--danger); }
.alert-warning { background: rgba(245,158,11,0.15); border: 1px solid var(--warning); color: var(--warning); }
.alert-info { background: rgba(59,130,246,0.15); border: 1px solid var(--info); color: var(--info); }

/* ===================== POPULAR TABS ===================== */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}

.tab-btn.active, .tab-btn:hover { color: var(--primary-light); border-bottom-color: var(--primary); }

/* ===================== AUTH FORMS ===================== */
.auth-wrap {
  max-width: 420px;
  margin: 40px auto;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--border);
}

.auth-title { font-size: 1.4rem; font-weight: 700; text-align: center; margin-bottom: 24px; }
.auth-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text2); }

/* ===================== SIMILAR NOVELS ===================== */
.similar-novels { margin-top: 24px; }

/* ===================== FOOTER ===================== */
.site-footer {
  background: var(--bg3);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 32px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.footer-col h3, .footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 12px;
}

.footer-col p { font-size: 13px; color: var(--text2); margin-bottom: 8px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { font-size: 13px; color: var(--text2); }
.footer-col ul li a:hover { color: var(--primary-light); }
.footer-contact { font-size: 13px; color: var(--text3); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text3);
}

.footer-bottom p:first-child { margin-bottom: 4px; }

/* ===================== MISC ===================== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text2);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { margin-bottom: 8px; }

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.5rem; margin-bottom: 8px; }
.page-header p { color: var(--text2); font-size: 14px; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { background: var(--card2); padding: 12px 16px; text-align: left; font-weight: 600; border-bottom: 1px solid var(--border); }
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text2); }
tbody tr:hover td { background: var(--card2); }
tbody tr:last-child td { border-bottom: none; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text3); }
.text-primary { color: var(--primary-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ===================== READING SETTINGS PANEL ===================== */
.reading-settings {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
}

.reading-settings-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.reading-settings-panel {
  position: absolute;
  bottom: 54px;
  right: 0;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  width: 200px;
  display: none;
}

.reading-settings-panel.open { display: block; }
.settings-row { margin-bottom: 12px; font-size: 13px; color: var(--text2); }
.settings-row label { display: block; margin-bottom: 6px; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .layout-main { 
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "sidebar";
  }
}

@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; }
  .search-form { order: 3; width: 100%; max-width: 100%; }
  .logo { flex: 1; }
  .theme-toggle { order: 1; }
  .nav-toggle { display: block; order: 2; }
  .main-nav { order: 4; width: 100%; }
  .main-nav > ul {
    display: none;
    flex-direction: column;
    position: static;
    width: 100%;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 0;
    margin-top: 4px;
  }
  .main-nav > ul.open { display: flex; }
  .main-nav > ul > li { width: 100%; }
  .main-nav > ul > li > a { border-radius: 0; padding: 10px 16px; }
  /* Mobile dropdown - open state */
  .has-dropdown .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--primary);
    margin-left: 16px;
    border-radius: 0;
    display: none;
    animation: none;
  }
  .has-dropdown.open .dropdown { display: flex !important; }
  .novel-header { flex-direction: column; align-items: center; text-align: center; }
  .novel-cover-wrap { width: 120px; }
  .novel-actions { justify-content: center; }
  .novel-stats { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .novel-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .chapter-content { padding: 16px 18px; font-size: 16px; line-height: 1.8; }
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ===================== SELECTION ===================== */
::selection { background: var(--primary); color: #fff; }
