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

:root {
  --sidebar-w: 64px;
  --grad-top: rgb(187, 0, 255);
  --grad-bottom: rgb(96, 8, 120);
}

html, body { min-height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #fff;
  background: linear-gradient(160deg, var(--grad-bottom) 0%, var(--grad-top) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ---------- Barra lateral ---------- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(20, 0, 30, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  z-index: 20;
}
.logo img {
  width: 38px; height: 38px;
  border-radius: 9px;
  object-fit: cover;
  display: block;
}
.nav {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
}
.nav-toggle {
  background: none; border: 0; color: rgba(255,255,255,.75);
  font-size: 20px; cursor: pointer; line-height: 1;
}
.nav-item {
  color: rgba(255,255,255,.8);
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Conteúdo ---------- */
.content {
  margin-left: var(--sidebar-w);
  padding: 26px 28px 80px;
  max-width: 1180px;
}

.shelf { margin-bottom: 40px; }
.shelf-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.92);
  margin: 0 0 14px 2px;
}

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

/* Dashboard: carrossel horizontal por secção (como o original) */
.shelf .grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 16px;
  padding-bottom: 10px;
  scrollbar-width: thin;
}
.shelf .grid .card {
  flex: 0 0 auto;
  width: 168px;
  aspect-ratio: 2 / 3;
}
.shelf .grid::-webkit-scrollbar { height: 8px; }
.shelf .grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 4px; }

.card {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: rgba(0,0,0,.25);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0,0,0,.5);
}
.card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  .content { padding: 18px 14px 60px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
}

/* ---------- Páginas internas ---------- */
.back { display:inline-block; color:rgba(255,255,255,.85); text-decoration:none; font-size:14px; margin-bottom:18px; }
.back:hover { color:#fff; text-decoration:underline; }
.prod-title, .lesson-title { font-size:26px; font-weight:800; margin:0 0 22px; text-shadow:0 2px 8px rgba(0,0,0,.4); }
.card { position:relative; }
.card.locked { opacity:.85; }
.card .lock { position:absolute; top:8px; right:8px; font-size:18px; filter:drop-shadow(0 1px 2px #000); }
.lesson-card { aspect-ratio:auto; display:flex; flex-direction:column; background:rgba(0,0,0,.22); }
.lesson-card img { width:100%; height:auto; aspect-ratio:auto; object-fit:cover; display:block; }
.card-cap { display:block; padding:10px 10px; font-size:13px; font-weight:600; line-height:1.25; color:#fff; text-align:center; }
/* Grelha de lições: cartões de 220px com aspeto preservado, como o original (desktop+mobile) */
.content > .grid { grid-template-columns: repeat(auto-fill, 220px); justify-content: center; gap: 22px 16px; }
.lesson { max-width:900px; }
.player { width:100%; aspect-ratio:16/9; border-radius:14px; background:rgba(0,0,0,.45);
  display:grid; place-items:center; border:1px solid rgba(255,255,255,.12); }
.player-inner { text-align:center; color:rgba(255,255,255,.85); }
.player-inner .play { width:64px; height:64px; fill:none; stroke:rgba(255,255,255,.9); stroke-width:1.4; }
.player-inner p { font-size:16px; font-weight:700; margin:10px 0 4px; }
.player-inner small { font-size:12px; color:rgba(255,255,255,.6); }
.hint { margin-top:18px; font-size:13px; color:rgba(255,255,255,.7); max-width:680px; line-height:1.5; }

.prod-head{display:flex;align-items:center;gap:18px;margin-bottom:24px}
.prod-cover{width:90px;border-radius:10px;box-shadow:0 6px 18px rgba(0,0,0,.4)}
.prod-head .prod-title{margin:0}

video.player{object-fit:contain;background:#000;aspect-ratio:16/9;width:100%;height:auto;display:block}

iframe.player.pdf{width:100%;height:80vh;aspect-ratio:auto;background:#fff;border:1px solid var(--line,rgba(255,255,255,.12));border-radius:14px;display:block}
.dl{display:inline-block;color:#fff;background:rgba(228,75,154,.25);border:1px solid rgba(228,75,154,.5);padding:8px 16px;border-radius:8px;text-decoration:none;font-weight:600}
.dl:hover{background:rgba(228,75,154,.4)}

/* ---------- Toast "no content yet" (como o original / iziToast) ---------- */
.card.soon { cursor: pointer; }
.toast-wrap { position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: #1aa7b8; color: #fff; padding: 14px 20px; border-radius: 8px;
  font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.3);
  max-width: 340px; opacity: 0; transform: translateX(24px);
  transition: opacity .35s ease, transform .35s ease;
}
.toast.show { opacity: 1; transform: none; }
@media (max-width: 640px) { .toast-wrap { left: 16px; right: 16px; } .toast { max-width: none; } }

/* ---------- Botão "abrir e-book" (robusto, funciona em mobile) ---------- */
.ebook-open { display:inline-flex; align-items:center; gap:8px; background:#e44b9a; color:#fff; text-decoration:none; font-weight:800; font-size:15px; padding:13px 22px; border-radius:10px; margin-bottom:16px; box-shadow:0 6px 18px rgba(228,75,154,.4); }
.ebook-open:hover { background:#d13a87; }
.dl-link { color:#cf9bf0; }

/* ---------- #5 chat (Talk With Shulammite) ---------- */
.chat-page { display:flex; flex-direction:column; align-items:center; text-align:center; margin-top:30px; }
.chat-avatar { width:150px; height:150px; border-radius:14px; object-fit:cover; box-shadow:0 8px 24px rgba(0,0,0,.4); }
.chat-desc { max-width:560px; margin-top:22px; font-size:15px; line-height:1.6; color:rgba(255,255,255,.92); }
/* ---------- #6 suporte (galeria de cartões) ---------- */
.gallery { display:flex; flex-direction:column; align-items:center; gap:26px; margin-top:10px; }
.gallery-img { width:300px; max-width:90%; border-radius:14px; box-shadow:0 8px 24px rgba(0,0,0,.4); display:block; }

/* ================= MOBILE (igual ao original) ================= */
.mtop { display: none; }
.mobile-hero { display: none; }
@media (max-width: 640px) {
  .sidebar { display: none; }
  .content { margin-left: 0; padding: 16px 14px 70px; }
  /* barra de topo (logo + ícones), como o original */
  .mtop {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; position: sticky; top: 0; z-index: 40;
    background: rgba(20,0,30,.55); backdrop-filter: blur(8px);
  }
  .mtop-logo { width: 34px; height: 34px; border-radius: 8px; display: block; }
  .mtop-icons { display: flex; gap: 20px; }
  .mtop-icons a { color: #fff; display: inline-flex; }
  .mtop-icons svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  /* hero no topo (só mobile, como o original) */
  .mobile-hero { display: block; width: 100%; height: auto; margin: 0 0 8px; }
  /* cartões dimensionados para telemóvel */
  .shelf .grid .card { width: 120px; }
  .lesson, .content { max-width: 100%; }
  .prod-cover { width: 64px; }
  .prod-title, .lesson-title { font-size: 20px; }
  .chat-avatar { width: 120px; height: 120px; }
  .gallery-img { width: 88%; }
  iframe.player.pdf { height: 70vh; }
  /* lições 1 por linha (full-width), como o original */
  /* lições: 220px centradas (preservam aspeto) — exatamente como o original */
  .content > .grid { grid-template-columns: repeat(auto-fill, 220px); justify-content: center; gap: 22px 14px; }
  .card-cap { font-size: 13px; padding: 10px 12px; text-align: center; }
  .mnav { display: flex !important; }
  .content { padding-bottom: 84px; } /* espaço para a barra inferior fixa */
}
/* barra de navegação inferior (← Back · Home · Menu), como o original — só mobile */
.mnav { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
  align-items: stretch; justify-content: space-around;
  background: linear-gradient(0deg, rgb(150,0,210), var(--grad-top, rgb(187,0,255)));
  box-shadow: 0 -4px 16px rgba(0,0,0,.35); }
.mnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0; color: #fff; text-decoration: none; font-size: 11px; font-weight: 600; }
.mnav svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* email de apoio (#6) */
.support-email { display:inline-flex; align-items:center; gap:8px; margin-top:6px; background:rgba(228,75,154,.2); border:1px solid rgba(228,75,154,.5); color:#fff; text-decoration:none; font-weight:700; font-size:15px; padding:12px 20px; border-radius:10px; }
.support-email:hover { background:rgba(228,75,154,.38); }

/* visor de e-book em canvas (PDF.js) */
.pdfjs-viewer { width:100%; max-width:900px; display:flex; flex-direction:column; gap:10px; }
.pdf-page { width:100%; height:auto; border-radius:8px; box-shadow:0 4px 14px rgba(0,0,0,.3); background:#fff; }
.pdf-loading { color:rgba(255,255,255,.7); font-size:14px; padding:20px 0; }
