/* ═══════════════════════════════════════════════
   VOOMCOMIX DESIGN SYSTEM
   Palette derived from logo: Navy + Pink + Purple
═══════════════════════════════════════════════ */

:root {
  /* ── Brand Colors (from logo) ── */
  --brand-navy: #191833;
  --brand-pink: #ec1561;
  --brand-purple: #7b2ff7;
  --brand-gradient: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-purple) 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(236,21,97,0.08), rgba(123,47,247,0.08));

  /* ── Backgrounds (white-based, as requested) ── */
  --bg: #ffffff;
  --bg2: #faf9fc;
  --bg3: #f5f3fa;
  --card-bg: #ffffff;

  /* ── Text ── */
  --text: var(--brand-navy);
  --muted: #6b6880;
  --faint: #a3a0b3;

  /* ── Borders / Shadows ── */
  --border: #ece9f5;
  --shadow-sm: 0 2px 8px rgba(25,24,51,0.05);
  --shadow-md: 0 8px 24px rgba(25,24,51,0.08);
  --shadow-lg: 0 16px 40px rgba(123,47,247,0.12);
  --shadow-pink: 0 8px 20px rgba(236,21,97,0.25);
  --shadow-purple: 0 8px 20px rgba(123,47,247,0.25);

  /* ── Type Colors ── */
  --manga-color: #ff6b9d;
  --comic-color: #f4a261;
  --novel-color: #4ecdc4;

  /* ── Fonts ── */
  --font-display: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* ── Radius ── */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ═══════════════════════════════════════
   HEADER
═══════════════════════════════════════ */
header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo-wrap { flex-shrink: 0; transition: transform 0.25s ease; }
.header-logo-wrap:hover { transform: scale(1.04); }

.nav-center { display: flex; align-items: center; gap: 18px; }
.home-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, color 0.2s ease;
}
.home-link:hover { background: var(--bg3); color: var(--brand-purple); }

.nav-type-links { display: flex; gap: 6px; }
.nav-type-links a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 20px;
  transition: all 0.2s ease;
}
.nav-type-links a.manga { color: var(--manga-color); }
.nav-type-links a.comic { color: var(--comic-color); }
.nav-type-links a.novel { color: var(--novel-color); }
.nav-type-links a:hover { background: var(--bg3); transform: translateY(-1px); }

/* ── Search ── */
.search-wrap { flex: 1; max-width: 360px; position: relative; }
.search-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 30px;
  padding: 9px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input-row:hover, .search-input-row:focus-within {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 4px rgba(123,47,247,0.08);
}
.search-input-row input {
  flex: 1; border: none; background: transparent; outline: none;
  font-family: var(--font-body); font-size: 14px; color: var(--text);
}
.search-icon { cursor: pointer; opacity: 0.6; }
.search-clear { border: none; background: none; cursor: pointer; opacity: 0; transition: opacity 0.2s; color: var(--muted); }
.search-clear.show { opacity: 1; }

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 200;
}
.search-dropdown.show { display: block; }
.search-section-label { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.5px; padding: 12px 16px 6px; }
.search-result-item, .recent-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; transition: background 0.15s; justify-content: space-between; }
.search-result-item:hover, .recent-item:hover { background: var(--bg2); }
.recent-item-left { display: flex; align-items: center; gap: 10px; flex: 1; font-size: 13px; color: var(--muted); }
.recent-remove { border: none; background: none; opacity: 0.4; cursor: pointer; font-size: 12px; }
.search-result-thumb { width: 36px; height: 48px; border-radius: 6px; overflow: hidden; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.search-result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-result-info .title { font-size: 13px; font-weight: 600; color: var(--text); }
.search-result-info .meta { font-size: 11px; color: var(--faint); }
.search-no-result { padding: 20px; text-align: center; color: var(--faint); font-size: 13px; }
.clear-all-recent { width: 100%; padding: 10px; border: none; background: none; color: var(--brand-pink); font-size: 12px; font-weight: 600; cursor: pointer; border-top: 1px solid var(--border); }

/* ── Buttons ── */
.btn { padding: 9px 18px; border-radius: 24px; font-family: var(--font-display); font-weight: 600; font-size: 13px; cursor: pointer; border: none; transition: all 0.25s ease; }
.btn-writer { background: var(--brand-gradient); color: #fff; box-shadow: var(--shadow-purple); }
.btn-writer:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(123,47,247,0.35); }

.btn-large {
  padding: 14px 30px; border-radius: 28px; font-family: var(--font-display);
  font-weight: 700; font-size: 15px; cursor: pointer; border: none;
  transition: all 0.25s ease; display: inline-flex; align-items: center; gap: 8px;
}
.btn-large-primary { background: var(--brand-gradient); color: #fff; box-shadow: var(--shadow-pink); }
.btn-large-primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 16px 36px rgba(236,21,97,0.35); }
.btn-large-ghost { background: #fff; color: var(--brand-navy); border: 1.5px solid var(--border); }
.btn-large-ghost:hover { border-color: var(--brand-purple); color: var(--brand-purple); transform: translateY(-2px); }

/* ── User menu ── */
.user-menu { position: relative; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; cursor: pointer; border: 2px solid var(--brand-pink); transition: transform 0.2s; }
.user-avatar:hover { transform: scale(1.08); }
.user-dropdown {
  display: none; position: absolute; top: calc(100% + 10px); right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); min-width: 200px; overflow: hidden; z-index: 200;
}
.user-dropdown.show { display: block; }
.user-dropdown-item { padding: 12px 18px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.user-dropdown-item:hover { background: var(--bg2); }
.user-dropdown-item.danger { color: var(--brand-pink); }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ═══════════════════════════════════════
   MOBILE HEADER ELEMENTS
═══════════════════════════════════════ */
.mob-hamburger { display: none; flex-direction: column; gap: 5px; border: none; background: none; cursor: pointer; padding: 6px; }
.mob-hamburger span { width: 22px; height: 2.5px; background: var(--brand-navy); border-radius: 2px; transition: all 0.3s ease; }
.mob-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mob-hamburger.open span:nth-child(2) { opacity: 0; }
.mob-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mob-header-right { display: none; align-items: center; gap: 10px; }
.mob-search-icon-btn { border: none; background: var(--bg2); color: var(--brand-navy); width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mob-login-btn { background: var(--brand-gradient); color: #fff; border: none; padding: 9px 16px; border-radius: 20px; font-weight: 700; font-size: 13px; font-family: var(--font-display); box-shadow: var(--shadow-pink); }
.mob-user-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; cursor: pointer; border: 2px solid var(--brand-pink); }

/* ── Mobile Explore Panel ── */
.mob-explore-panel {
  position: fixed; top: 0; left: -85%; width: 85%; max-width: 340px; height: 100vh;
  background: #fff; z-index: 999; overflow-y: auto; transition: left 0.3s ease;
  box-shadow: var(--shadow-lg); padding: 24px 0;
}
.mob-explore-panel.open { left: 0; }
.mob-panel-section-label { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.8px; padding: 16px 20px 8px; }
.mob-panel-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 20px; position: relative;
  width: 100%; border: none; background: none; text-align: left; cursor: pointer; font-family: var(--font-body);
}
.mob-accent-bar { position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; }
.mob-panel-item-icon { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.mob-panel-item-label { flex: 1; font-size: 15px; font-weight: 600; color: var(--text); }
.mob-panel-item-arrow { color: var(--faint); font-size: 18px; }

.mob-search-panel {
  position: fixed; top: 0; left: 0; width: 100%; height: auto; background: #fff;
  z-index: 999; transform: translateY(-100%); transition: transform 0.3s ease;
  box-shadow: var(--shadow-md); padding: 14px 16px;
}
.mob-search-panel.open { transform: translateY(0); }
.mob-search-panel-inner { display: flex; align-items: center; gap: 10px; background: var(--bg2); border-radius: 24px; padding: 10px 16px; }
.mob-search-panel-inner input { flex: 1; border: none; background: transparent; outline: none; font-size: 14px; }
.mob-search-panel-close { border: none; background: none; cursor: pointer; font-size: 16px; color: var(--muted); }

.mob-panel-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(25,24,51,0.35);
  z-index: 998; backdrop-filter: blur(2px);
}
.mob-panel-backdrop.open { display: block; }

/* ═══════════════════════════════════════
   INSTALL MODAL
═══════════════════════════════════════ */
.install-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(25,24,51,0.5);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.install-modal-overlay.show { display: flex; }
.install-modal { background: #fff; border-radius: var(--radius-lg); padding: 32px 28px; max-width: 360px; text-align: center; box-shadow: var(--shadow-lg); }
.install-modal-icon img { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 16px; }
.install-modal h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: 8px; }
.install-modal p { color: var(--muted); font-size: 13px; line-height: 1.6; margin-bottom: 20px; }
.install-modal-btns { display: flex; flex-direction: column; gap: 10px; }
.install-btn-main { background: var(--brand-gradient); color: #fff; border: none; padding: 13px; border-radius: 24px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: var(--font-display); }
.install-btn-close { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 6px; }
.install-already { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

/* ═══════════════════════════════════════
   TRENDING SECTION
═══════════════════════════════════════ */
.trending-section { padding: 40px 32px 20px; background: var(--bg); }
.trending-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.section-label { font-size: 12px; font-weight: 700; color: var(--brand-pink); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.view-all-link { font-size: 13px; font-weight: 600; color: var(--brand-purple); transition: opacity 0.2s; }
.view-all-link:hover { opacity: 0.7; }

.trending-scroll-wrap { position: relative; }
.trending-row { display: flex; gap: 16px; overflow-x: auto; scroll-behavior: smooth; padding-bottom: 8px; scrollbar-width: none; }
.trending-row::-webkit-scrollbar { display: none; }

.trending-scroll-btn {
  position: absolute; top: 40%; width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10;
  font-size: 18px; color: var(--brand-navy); transition: all 0.2s ease;
}
.trending-scroll-btn:hover { background: var(--brand-gradient); color: #fff; border-color: transparent; }
.trending-scroll-btn.prev { left: -8px; }
.trending-scroll-btn.next { right: -8px; }

.trending-card {
  flex: 0 0 150px; cursor: pointer; border-radius: var(--radius-md); overflow: hidden;
  background: var(--card-bg); border: 1px solid var(--border); transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}
.trending-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(123,47,247,0.2); }
.trending-card-img { position: relative; height: 200px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 40px; }
.trending-card-img img { width: 100%; height: 100%; object-fit: cover; }
.trending-card-img-emoji { font-size: 40px; }
.trending-card-badge { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 10px; text-transform: capitalize; backdrop-filter: blur(4px); }
.trending-card-lang { position: absolute; top: 8px; right: 8px; font-size: 9px; font-weight: 700; padding: 3px 6px; border-radius: 8px; background: rgba(255,255,255,0.9); color: var(--brand-navy); }
.trending-card-info { padding: 10px 12px 12px; }
.trending-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trending-card-meta { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--faint); margin-bottom: 8px; }
.trending-card-genre { text-transform: capitalize; }

.status-badge { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 8px; }
.badge-hot { background: rgba(236,21,97,0.12); color: var(--brand-pink); }
.badge-trending { background: rgba(123,47,247,0.12); color: var(--brand-purple); }
.badge-new { background: rgba(78,205,196,0.12); color: var(--novel-color); }

.read-now-btn {
  display: block; text-align: center; background: var(--brand-gradient); color: #fff;
  font-size: 11px; font-weight: 700; padding: 7px; border-radius: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.read-now-btn:hover { transform: scale(1.03); box-shadow: var(--shadow-pink); }

/* ═══════════════════════════════════════
   AD UNITS
═══════════════════════════════════════ */
.ad-unit { display: flex; justify-content: center; align-items: center; margin: 28px auto; max-width: 100%; min-height: 50px; }

/* ═══════════════════════════════════════
   BOOK SECTIONS
═══════════════════════════════════════ */
.books-section { padding: 40px 32px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; }
.section-heading { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: 0.3px; }

.books-scroll { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.books-scroll::-webkit-scrollbar { display: none; }

.book-card {
  flex: 0 0 150px; cursor: pointer; transition: transform 0.25s ease;
}
.book-card:hover { transform: translateY(-6px); }
.book-cover {
  height: 200px; border-radius: var(--radius-md); background: var(--bg3); overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  box-shadow: var(--shadow-sm); margin-bottom: 10px; transition: box-shadow 0.25s ease;
}
.book-card:hover .book-cover { box-shadow: var(--shadow-lg); }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.book-meta { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.book-type-badge { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 8px; text-transform: capitalize; }
.badge-manga { background: rgba(255,107,157,0.12); color: var(--manga-color); }
.badge-comic { background: rgba(244,162,97,0.12); color: var(--comic-color); }
.badge-novel { background: rgba(78,205,196,0.12); color: var(--novel-color); }
.book-lang-badge { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--bg3); color: var(--muted); }

.cover-placeholder { flex: 0 0 150px; height: 200px; border-radius: var(--radius-md); }

/* ═══════════════════════════════════════
   TAGS SECTION
═══════════════════════════════════════ */
.tags-section { padding: 30px 32px 40px; }
.tags-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tag-pill {
  padding: 9px 18px; border-radius: 22px; background: var(--bg2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text); transition: all 0.22s ease;
}
.tag-pill:hover { background: var(--brand-gradient); color: #fff; border-color: transparent; transform: translateY(-2px); box-shadow: var(--shadow-purple); }

/* ═══════════════════════════════════════
   NEW RELEASES
═══════════════════════════════════════ */
.new-releases-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.new-release-card {
  display: flex; gap: 12px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px; cursor: pointer; transition: all 0.25s ease;
}
.new-release-card:hover { box-shadow: var(--shadow-md); border-color: rgba(236,21,97,0.2); transform: translateY(-3px); }
.new-release-img { width: 70px; height: 94px; border-radius: 8px; background: var(--bg3); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; overflow: hidden; }
.new-release-img img { width: 100%; height: 100%; object-fit: cover; }
.new-release-info { flex: 1; min-width: 0; }
.new-release-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.new-release-author { font-size: 11px; color: var(--brand-purple); margin-bottom: 6px; font-weight: 600; }
.new-release-desc { font-size: 11px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ═══════════════════════════════════════
   BENEFITS SECTION
═══════════════════════════════════════ */
.benefits-section { padding: 60px 32px; background: var(--bg2); }
.benefits-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1100px; margin: 36px auto 0; }
.benefit-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px 24px; text-align: center; transition: all 0.3s ease; box-shadow: var(--shadow-sm);
}
.benefit-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(123,47,247,0.2); }
.benefit-icon {
  width: 56px; height: 56px; border-radius: 16px; background: var(--brand-gradient-soft);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  margin: 0 auto 16px;
}
.benefit-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.benefit-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ═══════════════════════════════════════
   WRITER CTA
═══════════════════════════════════════ */
.writer-cta {
  padding: 70px 32px; text-align: center; background: var(--brand-navy);
  border-radius: 0; position: relative; overflow: hidden;
}
.writer-cta::before {
  content: ''; position: absolute; top: -50%; right: -10%; width: 400px; height: 400px;
  background: var(--brand-gradient); opacity: 0.25; border-radius: 50%; filter: blur(80px);
}
.writer-cta::after {
  content: ''; position: absolute; bottom: -50%; left: -10%; width: 350px; height: 350px;
  background: var(--brand-purple); opacity: 0.2; border-radius: 50%; filter: blur(80px);
}
.writer-cta h2 { font-family: var(--font-display); font-size: 38px; color: #fff; line-height: 1.25; position: relative; z-index: 1; margin-bottom: 14px; }
.writer-cta p { color: rgba(255,255,255,0.7); max-width: 480px; margin: 0 auto 30px; font-size: 15px; position: relative; z-index: 1; }
.writer-cta .section-label { color: var(--brand-pink); }
.cta-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }
.writer-cta .btn-large-ghost { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.2); }
.writer-cta .btn-large-ghost:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.4); color: #fff; }

/* ═══════════════════════════════════════
   UPDATES SECTION
═══════════════════════════════════════ */
.updates-section { padding: 50px 32px; }
.updates-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.update-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 20px; transition: all 0.25s ease;
}
.update-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.update-type { font-size: 11px; font-weight: 700; color: var(--brand-purple); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.update-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.update-text { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.update-date { font-size: 11px; color: var(--faint); }

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
footer { background: var(--brand-navy); color: rgba(255,255,255,0.7); padding: 60px 32px 24px; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; max-width: 1200px; margin: 0 auto 40px; }
.footer-brand p { font-size: 13px; line-height: 1.7; margin: 14px 0 18px; color: rgba(255,255,255,0.55); max-width: 280px; }
.footer-socials { display: flex; gap: 10px; margin-bottom: 16px; }
.social-btn {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff;
  transition: all 0.2s ease;
}
.social-btn:hover { background: var(--brand-gradient); transform: translateY(-2px); }
.footer-emails a { font-size: 13px; color: rgba(255,255,255,0.6); transition: color 0.2s; }
.footer-emails a:hover { color: var(--brand-pink); }
.footer-col h4 { font-family: var(--font-display); font-size: 14px; color: #fff; margin-bottom: 16px; letter-spacing: 0.3px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 13px; color: rgba(255,255,255,0.55); transition: color 0.2s; }
.footer-col a:hover { color: var(--brand-pink); }
.footer-bottom { text-align: center; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 12px; color: rgba(255,255,255,0.4); }
.footer-bottom p { margin: 4px 0; }

/* ═══════════════════════════════════════
   AUTH MODAL
═══════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(25,24,51,0.55);
  z-index: 1000; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(3px);
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg); padding: 32px; max-width: 400px;
  width: 100%; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: var(--shadow-lg);
}
.modal-close { position: absolute; top: 16px; right: 16px; border: none; background: var(--bg2); width: 32px; height: 32px; border-radius: 50%; font-size: 16px; cursor: pointer; color: var(--muted); }
.modal-tabs { display: flex; gap: 6px; background: var(--bg2); border-radius: 30px; padding: 4px; margin-bottom: 22px; }
.modal-tab { flex: 1; padding: 10px; border: none; background: none; border-radius: 26px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); font-family: var(--font-display); transition: all 0.2s ease; }
.modal-tab.active { background: var(--brand-gradient); color: #fff; box-shadow: var(--shadow-pink); }
.modal h2 { font-family: var(--font-display); font-size: 22px; margin-bottom: 4px; }
.modal .subtitle { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; font-family: var(--font-body);
}
.form-group input:focus { border-color: var(--brand-purple); box-shadow: 0 0 0 4px rgba(123,47,247,0.08); }
.modal-submit {
  width: 100%; padding: 13px; border: none; border-radius: var(--radius-sm); background: var(--brand-gradient);
  color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; margin-top: 4px; font-family: var(--font-display);
  transition: all 0.2s ease;
}
.modal-submit:hover { box-shadow: var(--shadow-pink); transform: translateY(-1px); }
.modal-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.modal-footer-link { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.modal-footer-link a { color: var(--brand-purple); font-weight: 600; }
.modal-error, .modal-success { display: none; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 14px; line-height: 1.5; }
.modal-error.show { display: block; background: rgba(236,21,97,0.08); color: var(--brand-pink); }
.modal-success.show { display: block; background: rgba(78,205,196,0.1); color: #2a9d8f; }

.role-selector { display: flex; gap: 10px; margin-bottom: 18px; }
.role-option { flex: 1; border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 16px 10px; text-align: center; cursor: pointer; transition: all 0.2s ease; }
.role-option.selected { border-color: var(--brand-purple); background: var(--brand-gradient-soft); }
.role-icon { font-size: 24px; margin-bottom: 6px; }
.role-name { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.role-desc { font-size: 10.5px; color: var(--muted); }

/* ═══════════════════════════════════════
   TOAST
═══════════════════════════════════════ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--brand-navy); color: #fff; padding: 13px 24px; border-radius: 30px;
  font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: all 0.3s ease;
  z-index: 2000; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #2a9d8f; }
.toast.error { background: var(--brand-pink); }

/* ═══════════════════════════════════════
   PWA BANNER & BOTTOM NAV
═══════════════════════════════════════ */
.pwa-banner {
  position: fixed; bottom: -100px; left: 16px; right: 16px; background: #fff;
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 14px;
  display: flex; align-items: center; gap: 12px; z-index: 500; transition: bottom 0.4s ease;
  border: 1px solid var(--border);
}
.pwa-banner.show { bottom: 16px; }
.pwa-banner-icon img { width: 44px; height: 44px; border-radius: 10px; }
.pwa-banner-text { flex: 1; }
.pwa-banner-title { font-size: 13px; font-weight: 700; }
.pwa-banner-sub { font-size: 11px; color: var(--muted); }
.pwa-banner-btns { display: flex; gap: 6px; align-items: center; }
.pwa-btn-install { background: var(--brand-gradient); color: #fff; border: none; padding: 9px 16px; border-radius: 20px; font-size: 12px; font-weight: 700; cursor: pointer; }
.pwa-btn-reject { border: none; background: var(--bg2); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; color: var(--muted); }

.app-bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff;
  border-top: 1px solid var(--border); z-index: 500; padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(25,24,51,0.05);
}
.app-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--faint); font-weight: 600; }
.app-nav-item span:first-child { font-size: 19px; }
.app-nav-item.active { color: var(--brand-pink); }

/* ═══════════════════════════════════════
   PROFILE BOTTOM SHEET
═══════════════════════════════════════ */
.profile-sheet-overlay { display: none; position: fixed; inset: 0; background: rgba(25,24,51,0.45); z-index: 998; }
.profile-sheet-overlay.show { display: block; }
.profile-sheet {
  position: fixed; bottom: -100%; left: 0; right: 0; background: #fff;
  border-radius: 24px 24px 0 0; z-index: 999; transition: bottom 0.3s ease;
  max-height: 80vh; overflow-y: auto; padding: 10px 0 30px;
}
.profile-sheet.open { bottom: 0; }
.profile-sheet-handle { width: 40px; height: 4px; background: var(--border); border-radius: 4px; margin: 8px auto 16px; }
.profile-sheet-user { display: flex; align-items: center; gap: 14px; padding: 0 22px 18px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.profile-sheet-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--brand-gradient-soft); display: flex; align-items: center; justify-content: center; font-size: 22px; overflow: hidden; }
.profile-sheet-name { font-weight: 700; font-size: 15px; }
.profile-sheet-role { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; display: inline-block; margin-top: 4px; }
.role-reader { background: rgba(78,205,196,0.12); color: var(--novel-color); }
.role-writer { background: rgba(236,21,97,0.12); color: var(--brand-pink); }
.role-admin { background: rgba(123,47,247,0.12); color: var(--brand-purple); }
.profile-sheet-item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; width: 100%; border: none; background: none; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); }
.profile-sheet-item .psi-arrow { margin-left: auto; color: var(--faint); }
.profile-sheet-logout { color: var(--brand-pink); }
.profile-sheet-divider { height: 1px; background: var(--border); margin: 8px 0; }
.profile-sheet-loggedout { text-align: center; padding: 30px 22px; }
.profile-sheet-login-btn { background: var(--brand-gradient); color: #fff; border: none; padding: 13px 28px; border-radius: 24px; font-weight: 700; font-size: 14px; cursor: pointer; }

/* ═══════════════════════════════════════
   SKELETON LOADING
═══════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, #ece9f5 37%, var(--bg3) 63%);
  background-size: 400% 100%; animation: skeleton-shine 1.4s ease infinite;
}
@keyframes skeleton-shine { 0% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* ═══════════════════════════════════════
   RESPONSIVE — MOBILE
═══════════════════════════════════════ */
@media (max-width: 860px) {
  header { padding: 10px 14px; gap: 10px; }
  .mob-hamburger { display: flex; }
  .nav-center, .search-wrap, .desktop-only-nav, #loggedInNav { display: none !important; }
  .mob-header-right { display: flex; margin-left: auto; }

  .trending-section, .books-section, .tags-section, .benefits-section, .writer-cta, .updates-section, footer { padding-left: 16px; padding-right: 16px; }
  .section-heading { font-size: 21px; }
  .trending-card, .cover-placeholder, .book-card { flex: 0 0 120px; }
  .trending-card-img, .book-cover { height: 160px; }

  .new-releases-grid { grid-template-columns: 1fr; }
  .benefits-grid { grid-template-columns: 1fr; }
  .updates-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: span 2; }
  .writer-cta h2 { font-size: 28px; }
  .cta-buttons { flex-direction: column; align-items: stretch; }
  .btn-large { justify-content: center; }
}