:root {
  --demo-bg: #0b0d14;
  --demo-surface: #131726;
  --demo-card: #181d30;
  --demo-card-hover: #202742;
  --demo-border: rgba(255, 255, 255, 0.08);
  --demo-border-glow: rgba(99, 102, 241, 0.4);

  --demo-primary: #3b82f6;
  --demo-primary-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --demo-gold: #fbbf24;
  --demo-green: #10b981;
  --demo-rose: #f43f5e;

  --demo-text: #f8fafc;
  --demo-muted: #94a3b8;
  --demo-dim: #64748b;

  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--demo-bg);
  color: var(--demo-text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--demo-bg);
}
::-webkit-scrollbar-thumb {
  background: #242b45;
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: #364066;
}

.demo-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar */
.demo-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: rgba(19, 23, 38, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--demo-border);
  gap: 16px;
}

.demo-nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.brand-logo {
  width: 34px;
  height: 34px;
  background: var(--demo-primary-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.4);
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-accent {
  background: var(--demo-primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 13px;
  margin-left: 2px;
}

.brand-demo-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Nav Links */
.demo-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 7px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--demo-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #fff;
  background: rgba(59, 130, 246, 0.18);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

/* Right Nav Actions */
.demo-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-svg {
  position: absolute;
  left: 12px;
  color: var(--demo-dim);
  pointer-events: none;
}

.nav-search-box input {
  padding: 7px 12px 7px 34px;
  background: #0f121d;
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-pill);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  width: 200px;
  transition: all 0.2s ease;
}

.nav-search-box input:focus {
  outline: none;
  width: 260px;
  border-color: var(--demo-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.btn-back-api {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: #181d2e;
  border: 1px solid var(--demo-border);
  color: #c7d2fe;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-back-api:hover {
  background: #2563eb;
  color: #fff;
}

/* Main Container */
.demo-main-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px;
  flex: 1;
}

/* Spotlight Section (Hero Banner) */
.spotlight-section {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  padding: 40px 36px;
  background: linear-gradient(135deg, #161b2e 0%, #1e243d 100%);
  border: 1px solid var(--demo-border);
  display: flex;
  align-items: center;
  min-height: 240px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.spotlight-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  filter: blur(8px);
  transform: scale(1.1);
  pointer-events: none;
}

.spotlight-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

.spotlight-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 8px;
}

.spotlight-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 8px;
}

.spotlight-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}

.meta-rating {
  color: var(--demo-gold);
  font-weight: 700;
}

.meta-chapter {
  color: var(--demo-primary);
  font-weight: 600;
  background: rgba(59, 130, 246, 0.15);
  padding: 2px 7px;
  border-radius: 4px;
}

.spotlight-desc {
  font-size: 13px;
  color: var(--demo-muted);
  line-height: 1.6;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-spotlight-read {
  padding: 9px 20px;
  background: var(--demo-primary-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
  transition: all 0.2s;
}

.btn-spotlight-read:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

/* Sub-toolbar (A-Z toolbar & Favorite range tabs) */
.demo-subtoolbar {
  background: #141726;
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sub-btn {
  padding: 6px 12px;
  background: #1b2138;
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-sm);
  color: var(--demo-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.sub-btn:hover {
  background: var(--demo-primary);
  color: #fff;
}

.sub-btn.active {
  background: var(--demo-primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Section Header */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--demo-border);
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.section-subtitle {
  font-size: 12px;
  color: var(--demo-dim);
}

.section-info-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #111422;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--demo-border);
}

.dot-live {
  width: 7px;
  height: 7px;
  background: var(--demo-green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--demo-green);
}

.section-info-pill code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #60a5fa;
}

/* Loading */
.demo-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 14px;
  color: var(--demo-muted);
}

.demo-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--demo-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Manga Grid */
.demo-manga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.demo-card {
  background: var(--demo-card);
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.demo-card:hover {
  transform: translateY(-5px);
  background: var(--demo-card-hover);
  border-color: var(--demo-border-glow);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 16px rgba(59, 130, 246, 0.25);
}

.demo-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 142%;
  overflow: hidden;
  background: #0f121d;
}

.demo-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.demo-card:hover .demo-thumb {
  transform: scale(1.06);
}

.demo-badge-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--demo-primary-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}

.demo-badge-rating {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(11, 13, 20, 0.85);
  backdrop-filter: blur(6px);
  color: var(--demo-gold);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.demo-badge-type {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #e2e8f0;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.demo-badge-type.type-manga {
  background: rgba(190, 18, 60, 0.85);
  border: 1px solid rgba(251, 113, 133, 0.4);
  color: #ffe4e6;
}

.demo-badge-type.type-manhwa {
  background: rgba(14, 116, 144, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #e0f2fe;
}

.demo-badge-type.type-manhua {
  background: rgba(180, 83, 9, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fef3c7;
}

.demo-badge-chcount {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(6px);
  color: #38bdf8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.demo-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.demo-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.demo-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  margin-top: auto;
}

.demo-card-chapter {
  color: var(--demo-primary);
  font-weight: 600;
}

.demo-card-status {
  color: var(--demo-green);
  font-size: 10px;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 5px;
  border-radius: 4px;
}

/* Pagination */
.demo-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
  padding: 16px;
  background: var(--demo-surface);
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-md);
}

.demo-page-btn {
  padding: 8px 18px;
  background: #1b2138;
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.demo-page-btn:hover:not(:disabled) {
  background: var(--demo-primary);
  border-color: var(--demo-primary);
}

.demo-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.demo-page-text {
  font-size: 13px;
  color: var(--demo-muted);
}

/* ==========================================================================
   2. DEDICATED DETAIL PAGE VIEW (Full Page, bukan popup)
   ========================================================================== */
#detailPageView {
  animation: fadeInDetail 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDetail {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Detail Navigation / Breadcrumb */
.detail-page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 10px 16px;
  background: rgba(18, 22, 36, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-md);
}

.btn-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1e2640;
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-detail-back:hover {
  background: var(--demo-primary);
  border-color: var(--demo-primary);
  transform: translateX(-3px);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.5);
}

.detail-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.crumb-link {
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s;
}

.crumb-link:hover {
  color: var(--demo-primary);
  text-decoration: underline;
}

.crumb-sep {
  color: #475569;
}

.crumb-active {
  color: #f1f5f9;
  font-weight: 600;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Detail Hero Banner */
.detail-hero-banner {
  position: relative;
  background: #0f1322;
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.detail-hero-backdrop {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center 30%;
  filter: blur(40px) brightness(0.25) saturate(1.6);
  transform: scale(1.15);
  pointer-events: none;
  z-index: 1;
}

.detail-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 32px;
  padding: 32px;
  background: linear-gradient(to bottom, rgba(15, 19, 34, 0.55), rgba(11, 14, 24, 0.92));
}

/* Cover Wrapper & Actions */
.detail-cover-wrapper {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-cover-img {
  width: 100%;
  aspect-ratio: 3 / 4.3;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #161b2e;
}

.detail-cover-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-read-action {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  border: none;
}

.btn-read-action.primary {
  background: var(--demo-primary-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-read-action.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-read-action.secondary {
  background: rgba(30, 38, 64, 0.85);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.btn-read-action.secondary:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
  border-color: var(--demo-primary);
}

/* Detail Main Info */
.detail-main-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #1b2138;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-chip.genre {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.25);
  transition: all 0.15s;
}

.detail-chip.genre:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #fff;
}

.detail-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}

.detail-alt-title {
  font-size: 13px;
  color: #94a3b8;
  font-style: italic;
  margin: 0;
}

/* Attr Cards */
.detail-attr-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 4px 0;
}

.detail-attr-item {
  background: rgba(18, 23, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.detail-attr-item .attr-label {
  font-size: 10.5px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
}

.detail-attr-item .attr-value {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  margin-top: 2px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Synopsis Section */
.detail-synopsis-section {
  background: rgba(12, 15, 26, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 4px;
}

.synopsis-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #60a5fa;
  margin-bottom: 8px;
}

.synopsis-paragraph {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.7;
  margin: 0;
  white-space: pre-line;
}

/* Chapters Full Section */
.detail-chapters-section {
  margin-top: 28px;
  background: var(--demo-surface);
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.chapters-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--demo-border);
  margin-bottom: 20px;
}

.chapters-title-group {
  display: flex;
  flex-direction: column;
}

.chapters-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.chapters-subtitle {
  font-size: 12px;
  color: var(--demo-dim);
}

.chapters-filter-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chapter-search-input {
  background: #111422;
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12.5px;
  color: #fff;
  width: 200px;
  outline: none;
  transition: all 0.2s;
}

.chapter-search-input:focus {
  border-color: var(--demo-primary);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

.btn-sort-chapters {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1b2138;
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sort-chapters:hover {
  background: var(--demo-primary);
  color: #fff;
  border-color: var(--demo-primary);
}

/* Chapters Grid (Full page scrollable or expanded) */
.demo-chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 6px;
}

.btn-chapter-item {
  background: #111422;
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.btn-chapter-item:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--demo-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-chapter-item .ch-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.btn-chapter-item .ch-date {
  font-size: 10.5px;
  color: var(--demo-dim);
  margin-top: 3px;
}

/* Chapter Reader View (Full Screen) */
.demo-reader-overlay {
  position: fixed;
  inset: 0;
  background: #06070a;
  z-index: 500;
  display: flex;
  flex-direction: column;
}

.reader-floating-nav {
  position: sticky;
  top: 0;
  z-index: 510;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: rgba(15, 18, 28, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--demo-border);
}

.reader-info-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-reader-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1f2742;
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-pill);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
}

.btn-reader-back:hover {
  background: var(--demo-primary);
}

.reader-titles {
  display: flex;
  flex-direction: column;
}

.reader-comic-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.reader-chapter-title {
  font-size: 11px;
  color: #93c5fd;
  font-family: var(--font-mono);
}

.reader-nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reader-ctrl-btn {
  padding: 6px 14px;
  background: #181d30;
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.reader-ctrl-btn:hover:not(:disabled) {
  background: var(--demo-primary);
}

.reader-ctrl-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.reader-ch-select {
  padding: 6px 10px;
  background: #0f121d;
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-family: var(--font-sans);
  font-size: 12px;
}

/* Reader Scroll Stream */
.reader-scroll-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
}

.reader-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  gap: 16px;
  color: var(--demo-muted);
}

.reader-images-stream {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  max-width: 800px;
}

.reader-page-img {
  width: 100%;
  height: auto;
  display: block;
}

.reader-bottom-nav {
  display: flex;
  gap: 14px;
  margin: 40px 0 60px;
}

.btn-bottom-nav {
  padding: 10px 20px;
  background: #181d30;
  border: 1px solid var(--demo-border);
  border-radius: var(--radius-pill);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-bottom-nav.primary {
  background: var(--demo-primary-gradient);
  border: none;
}

/* Footer */
.demo-footer {
  margin-top: 40px;
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--demo-dim);
  border-top: 1px solid var(--demo-border);
}

/* Toast */
.demo-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1f2742;
  border: 1px solid var(--demo-primary);
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 999;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s;
  pointer-events: none;
}

.demo-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive Design System (Mobile, Tablet, Desktop)
   ========================================================================== */

/* Medium Screens / Tablets (max-width: 1024px) */
@media (max-width: 1024px) {
  .demo-main-container {
    padding: 20px 20px;
  }
  .demo-manga-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
  .spotlight-section {
    padding: 28px 24px;
    min-height: 200px;
  }
  .spotlight-title {
    font-size: 22px;
  }
}

/* Tablets Portrait (max-width: 768px) */
@media (max-width: 768px) {
  .demo-navbar {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }

  .demo-nav-left {
    flex: 1;
  }

  .demo-nav-right {
    order: 2;
  }

  .nav-search-box {
    width: 160px;
  }

  .nav-search-box input {
    width: 100%;
  }

  .nav-search-box input:focus {
    width: 180px;
  }

  .demo-nav-links {
    order: 3;
    width: 100%;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0 2px;
  }

  .demo-nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12.5px;
  }

  .demo-main-container {
    padding: 16px 14px;
  }

  .demo-subtoolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
  }

  .demo-subtoolbar::-webkit-scrollbar {
    display: none;
  }

  .sub-btn {
    flex-shrink: 0;
    padding: 6px 12px;
  }

  .demo-manga-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  /* Detail Page on Tablet */
  .detail-hero-content {
    gap: 24px;
    padding: 24px;
  }

  .detail-cover-wrapper {
    width: 180px;
  }

  .demo-chapters-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* Mobile Phones (max-width: 600px) */
@media (max-width: 600px) {
  .demo-navbar {
    padding: 8px 12px;
    gap: 8px;
  }

  .demo-nav-left {
    flex: 1;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }

  .brand-name {
    font-size: 14px;
  }

  .brand-demo-tag {
    display: none;
  }

  .demo-nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .btn-back-api {
    padding: 5px 10px;
    font-size: 11px;
  }

  .nav-search-box {
    order: 4;
    width: 100%;
    margin-top: 2px;
  }

  .nav-search-box input,
  .nav-search-box input:focus {
    width: 100%;
    font-size: 12px;
    padding: 7px 10px 7px 32px;
  }

  .demo-nav-links {
    order: 5;
    margin-top: 2px;
  }

  .nav-link {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  .demo-main-container {
    padding: 12px 10px;
  }

  /* Spotlight on Mobile */
  .spotlight-section {
    padding: 18px 14px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
  }

  .spotlight-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .spotlight-title {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .spotlight-desc {
    font-size: 11.5px;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .btn-spotlight-read {
    padding: 8px 18px;
    font-size: 12px;
    width: 100%;
  }

  /* Section Header on Mobile */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 14px;
  }

  .section-title {
    font-size: 17px;
  }

  .section-subtitle {
    font-size: 11px;
  }

  .section-info-pill {
    padding: 3px 8px;
  }

  .section-info-pill code {
    font-size: 10px;
  }

  /* 2-Column Mobile Grid */
  .demo-manga-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .demo-card {
    border-radius: var(--radius-sm);
  }

  .demo-card-body {
    padding: 9px 8px;
  }

  .demo-card-title {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .demo-card-meta {
    font-size: 10px;
  }

  .demo-card-chapter {
    font-size: 10px;
  }

  .demo-badge-rank {
    width: 20px;
    height: 20px;
    font-size: 9.5px;
    top: 6px;
    left: 6px;
  }

  .demo-badge-rating {
    font-size: 9.5px;
    padding: 1.5px 5px;
    top: 6px;
    right: 6px;
  }

  .demo-badge-type {
    font-size: 8.5px;
    padding: 1.5px 5px;
    bottom: 6px;
    left: 6px;
  }

  .demo-badge-chcount {
    font-size: 8.5px;
    padding: 1.5px 5px;
    bottom: 6px;
    right: 6px;
  }

  /* Pagination on Mobile */
  .demo-pagination {
    padding: 10px 12px;
    gap: 8px;
    margin-top: 24px;
  }

  .demo-page-btn {
    padding: 6px 12px;
    font-size: 11.5px;
  }

  .demo-page-text {
    font-size: 11.5px;
  }

  /* Dedicated Detail Page on Mobile */
  .detail-page-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
  }

  .btn-detail-back {
    font-size: 12px;
    padding: 6px 12px;
  }

  .crumb-active {
    max-width: 180px;
  }

  .detail-hero-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 14px;
    gap: 18px;
  }

  .detail-cover-wrapper {
    width: 160px;
    margin: 0 auto;
  }

  .detail-cover-actions {
    flex-direction: row;
    width: 100%;
  }

  .btn-read-action {
    flex: 1;
    font-size: 11.5px;
    padding: 8px 6px;
  }

  .detail-chips-row {
    justify-content: center;
  }

  .detail-title {
    font-size: 18px;
  }

  .detail-alt-title {
    font-size: 11.5px;
  }

  .detail-attr-cards {
    grid-template-columns: repeat(2, 1fr);
    text-align: left;
    width: 100%;
  }

  .detail-synopsis-section {
    text-align: left;
    padding: 14px;
  }

  .detail-synopsis-section p {
    font-size: 12px;
  }

  .detail-chapters-section {
    padding: 16px 12px;
    margin-top: 18px;
  }

  .chapters-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .chapters-filter-tools {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .chapter-search-input {
    width: 100%;
  }

  .btn-sort-chapters {
    width: 100%;
    justify-content: center;
  }

  .demo-chapters-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    max-height: 450px;
  }

  .btn-chapter-item {
    padding: 8px 8px;
  }

  .btn-chapter-item .ch-title {
    font-size: 11px;
  }

  .btn-chapter-item .ch-date {
    font-size: 9px;
  }

  /* Reader on Mobile */
  .reader-header {
    padding: 6px 10px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .reader-info-left {
    gap: 8px;
    flex: 1;
    min-width: 120px;
  }

  .btn-reader-back {
    padding: 4px 10px;
    font-size: 11px;
  }

  .reader-comic-title {
    font-size: 12px;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .reader-chapter-title {
    font-size: 10px;
  }

  .reader-nav-controls {
    gap: 4px;
  }

  .reader-ctrl-btn {
    padding: 4px 8px;
    font-size: 11px;
  }

  .reader-ch-select {
    padding: 4px 6px;
    font-size: 11px;
    max-width: 105px;
  }

  .reader-images-stream {
    max-width: 100%;
    padding: 0;
  }

  .reader-bottom-nav {
    margin: 20px 0 40px;
    gap: 8px;
  }

  .btn-bottom-nav {
    padding: 8px 16px;
    font-size: 12px;
  }
}

