/* ══════════════════════════════════════════
   VOOMCOMIX — MOBILE / RESPONSIVE STYLES
   mobile.css  (complete rewrite)
══════════════════════════════════════════ */

/* ════════════════════════════════════════
   PWA INSTALL BANNER
════════════════════════════════════════ */
.pwa-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(135deg, #1a1a24, #111118);
  border-top: 2px solid #e63946;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform .4s ease;
  box-shadow: 0 -4px 24px rgba(0,0,0,.5);
  max-height: 80px;
  overflow: hidden;
}
.pwa-banner.show { transform: translateY(0); }
.pwa-banner-icon { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; overflow: hidden; }
.pwa-banner-icon img { width: 100%; height: 100%; object-fit: cover; }
.pwa-banner-text { flex: 1; min-width: 0; }
.pwa-banner-title { font-weight: 700; font-size: 13px; color: #f0f0f5; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwa-banner-sub   { font-size: 11px; color: #8888a0; white-space: nowrap; }
.pwa-banner-btns  { display: flex; gap: 6px; flex-shrink: 0; }
.pwa-btn-install  { background: #e63946; color: #fff; border: none; padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 12px; cursor: pointer; font-family: 'Outfit', sans-serif; white-space: nowrap; }
.pwa-btn-reject   { background: transparent; color: #8888a0; border: 1px solid #2a2a3a; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 12px; cursor: pointer; font-family: 'Outfit', sans-serif; }

/* ════════════════════════════════════════
   APP BOTTOM NAV (PWA only)
════════════════════════════════════════ */
.app-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(10, 10, 15, .97);
  border-top: 1px solid var(--border);
  z-index: 400;
  height: 64px;
  padding: 0 8px;
  align-items: center;
  justify-content: space-around;
}
.app-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  min-width: 60px;
  -webkit-tap-highlight-color: transparent;
}
.app-nav-item span:first-child { font-size: 20px; line-height: 1; }
.app-nav-item.active,
.app-nav-item:active { color: var(--accent); }
.app-nav-item:hover  { color: var(--text); }

/* ════════════════════════════════════════
   PROFILE BOTTOM SHEET
════════════════════════════════════════ */
.profile-sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 450;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  backdrop-filter: blur(4px);
}
.profile-sheet-overlay.show { opacity: 1; pointer-events: all; }

.profile-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  z-index: 460;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  padding: 0 0 24px;
  max-height: 85vh;
  overflow-y: auto;
}
.profile-sheet.open { transform: translateY(0); }
.profile-sheet-handle { width: 40px; height: 4px; background: var(--faint); border-radius: 2px; margin: 12px auto 20px; }
.profile-sheet-user { display: flex; align-items: center; gap: 14px; padding: 0 20px 20px; border-bottom: 1px solid var(--border); }
.profile-sheet-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--bg3); border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; overflow: hidden; }
.profile-sheet-userinfo { flex: 1; min-width: 0; }
.profile-sheet-name  { font-weight: 700; font-size: 15px; color: var(--text); }
.profile-sheet-role  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.role-reader { color: #4ecdc4; }
.role-writer { color: #f4a261; }
.role-admin  { color: #e63946; }
.profile-sheet-menu { padding: 12px 0; }
.profile-sheet-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background .15s;
  color: var(--text);
  text-decoration: none;
  width: 100%;
  background: none; border: none;
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
}
.profile-sheet-item:hover,
.profile-sheet-item:active { background: var(--bg3); }
.psi-icon   { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.psi-label  { flex: 1; font-weight: 500; }
.psi-arrow  { color: var(--muted); font-size: 18px; }
.profile-sheet-divider { height: 1px; background: var(--border); margin: 6px 0; }
.profile-sheet-logout  { color: var(--accent); }
.profile-sheet-loggedout { padding: 24px 20px; text-align: center; }
.profile-sheet-login-btn { background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 13px 28px; font-family: var(--font-body); font-size: 14px; font-weight: 700; cursor: pointer; width: 100%; }

/* ════════════════════════════════════════
   TABLET  ≤ 1024px
════════════════════════════════════════ */
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}

/* ════════════════════════════════════════
   MOBILE  ≤ 768px
════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── HEADER: Logo | Explore | Search | Login ── */
  header {
    position: sticky;
    top: 0;
    z-index: 200;
    height: 56px;
    padding: 0 12px;
    gap: 8px;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 12px rgba(0,0,0,.07);
  }

  /* Logo — left anchor */
  header > a { flex-shrink: 0; display: flex; align-items: center; }
  header > a img { height: 34px; width: auto; }

  /* Desktop nav — gone */
  .nav-center { display: none !important; }

  /* Write button — gone on mobile */
  .btn-writer { display: none !important; }

  /* Search bar — flex-grow to fill space */
  .search-wrap {
    display: flex !important;
    flex: 1;
    min-width: 0;
    max-width: 200px;
    margin-left: 0;
  }
  .search-input-row {
    width: 100%;
    border-radius: 22px;
    padding: 0 8px;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    box-shadow: none;
    transition: border-color .2s;
  }
  .search-input-row:focus-within {
    border-color: var(--accent);
  }
  .search-icon { padding: 0 5px; font-size: 13px; }
  .search-input-row input {
    width: 100% !important;
    font-size: 13px;
    padding: 8px 2px;
  }
  .search-input-row input:focus { width: 100% !important; }
  .search-clear { display: none !important; }

  /* nav-right — only Login + avatar */
  .nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
  }

  /* Login button */
  .btn-login {
    padding: 7px 14px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Logged-in avatar — show on mobile too */
  #loggedInNav {
    display: flex !important;
    align-items: center;
  }
  #loggedInNav .user-avatar {
    display: block !important;
    width: 34px;
    height: 34px;
  }

  /* ── MOBILE EXPLORE DROPDOWN ── */
  .mobile-explore-wrap {
    display: block;
    flex-shrink: 0;
    position: relative;
  }

  /* ── HERO / TRENDING ── */
  .trending-section {
    padding: 16px 12px 20px;
  }

  .trending-header {
    margin-bottom: 12px;
  }

  .section-heading-lg {
    font-size: 22px;
  }

  .trending-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .trending-card-img {
    height: 150px;
    border-radius: 8px;
  }

  .trending-card-info {
    padding: 6px 1px 0;
  }

  .trending-card-title {
    font-size: 11px;
    height: auto;
    min-height: 26px;
    -webkit-line-clamp: 2;
    margin-bottom: 3px;
  }

  .trending-card-meta {
    font-size: 9px;
    color: var(--muted);
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin-bottom: 5px;
  }

  .trending-card .read-now-btn {
    display: block;
    margin-top: auto;
    padding: 5px 0;
    font-size: 9px;
    font-weight: 700;
    border-radius: 5px;
    text-align: center;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    letter-spacing: .3px;
  }

  .trending-card-lang {
    font-size: 8px;
    padding: 2px 5px;
  }

  .trending-card-badge {
    font-size: 8px;
    padding: 2px 5px;
  }

  /* Scroll buttons — hide */
  .trending-scroll-btn { display: none !important; }

  /* ── BOOK GRIDS ── */
  .books-section { padding: 16px 12px 20px; }

  :root {
    --thumb-w: 115px;
    --thumb-h: 155px;
  }

  .books-scroll {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .book-title { font-size: 11px; height: auto; min-height: 28px; }
  .book-meta  { font-size: 10px; gap: 4px; }

  /* ── SECTION LABELS / HEADINGS ── */
  .section-label { font-size: 10px; letter-spacing: 2px; }
  .section-heading { font-size: 22px; }

  /* ── NEW RELEASES ── */
  .new-releases-grid { grid-template-columns: 1fr; gap: 10px; }

  /* ── BENEFITS ── */
  .benefits-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .benefit-card  { padding: 16px 14px; }
  .benefit-icon  { font-size: 22px; margin-bottom: 8px; }
  .benefit-title { font-size: 13px; }
  .benefit-desc  { font-size: 11px; }

  /* ── WRITER CTA ── */
  .writer-cta { padding: 32px 16px; }
  .writer-cta-heading { font-size: 32px !important; }
  .writer-cta-sub     { font-size: 13px; }
  .cta-buttons        { flex-direction: column; align-items: center; gap: 8px; }
  .btn-large          { padding: 11px 24px; font-size: 13px; width: 100%; max-width: 280px; text-align: center; }

  /* ── TAGS ── */
  .tags-section { padding: 16px 12px 20px; }
  .tag-pill     { font-size: 12px; padding: 6px 12px; }

  /* ── UPDATES ── */
  .updates-section { padding: 16px 12px 20px; }
  .update-card     { padding: 14px; }

  /* ── FOOTER ── */
  .footer-top { grid-template-columns: 1fr 1fr; gap: 20px; }
  footer      { padding: 28px 16px 16px; }

  /* ── MISC HIDE ── */
  #mobileAllStories,
  #mobileContest,
  #mobileDownload,
  #mobileTypeLinks,
  .btn-mobile-search { display: none !important; }

  /* ── FOOTER CTA ROW ── */
  .footer-cta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  .footer-cta-btn {
    flex: 1;
    min-width: 90px;
    text-align: center;
    padding: 10px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .footer-cta-all     { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
  .footer-cta-contest { background: rgba(245,158,11,.12); color: #f59e0b; border: 1px solid rgba(245,158,11,.3); }
  .footer-cta-install { background: rgba(78,205,196,.12); color: #4ecdc4; border: 1px solid rgba(78,205,196,.3); }

  /* ── AD UNITS ── */
  .ad-unit { padding: 10px 12px; }
}

/* ════════════════════════════════════════
   MOBILE EXPLORE DROPDOWN
════════════════════════════════════════ */
.mobile-explore-wrap {
  position: relative;
  display: none;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .mobile-explore-wrap { display: block; }
}

.mobile-explore-btn {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-explore-btn:active { background: var(--border); }

.mobile-explore-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  z-index: 300;
  min-width: 150px;
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
}
.mobile-explore-dropdown.show { display: block; }

.mobile-explore-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: background .15s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-explore-item:hover,
.mobile-explore-item:active { background: var(--bg3); }
.mobile-explore-item.manga { border-left: 3px solid #ff6b9d; }
.mobile-explore-item.comic { border-left: 3px solid #f4a261; }
.mobile-explore-item.novel { border-left: 3px solid #4ecdc4; }

/* ════════════════════════════════════════
   SMALL PHONES  ≤ 480px
════════════════════════════════════════ */
@media (max-width: 480px) {

  header { padding: 0 10px; gap: 6px; height: 52px; }
  header > a img { height: 30px; }

  .search-wrap    { max-width: 150px; }
  .search-input-row input { font-size: 12px; padding: 7px 2px; }

  .btn-login {
    padding: 6px 11px !important;
    font-size: 11px !important;
  }

  :root {
    --thumb-w: 105px;
    --thumb-h: 140px;
  }

  .books-scroll  { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .trending-row  { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .trending-card-img { height: 130px; }

  .benefits-grid { grid-template-columns: 1fr; }
  .footer-top    { grid-template-columns: 1fr; }
  .writer-cta    { padding: 28px 12px; }
  .tags-section,
  .updates-section { padding: 14px 12px; }
  .update-card   { padding: 12px; }

  .section-heading { font-size: 20px; }
  .section-heading-lg { font-size: 20px; }
}

/* ════════════════════════════════════════
   MOBILE SEARCH BAR FALLBACK
════════════════════════════════════════ */
#mobileSearchBar { display: none; }

/* ════════════════════════════════════════
   SEARCH DROPDOWN — mobile positioning
════════════════════════════════════════ */
@media (max-width: 768px) {
  .search-dropdown {
    left: auto;
    right: 0;
    min-width: 260px;
    max-width: 90vw;
  }
}