/* =============================================
   MANNA INSTITUTE — Components
   Cards, Buttons, Badges, Toasts, Avatar, Progress
   ============================================= */

/* ── Card ── */
.card {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

.card-body { padding: 0; }
.card-body-lg { padding: 0; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-2xl);
  font-size: 0.875rem;
  font-weight: 800;
  padding: 12px 20px;
  transition: background var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  border: none;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { cursor: not-allowed; opacity: 0.6; }

.btn-primary {
  background: var(--color-pine);
  color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--color-leaf); }

.btn-secondary {
  background: white;
  color: var(--color-pine);
  border: 1px solid rgba(47, 106, 79, 0.15);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--color-pine);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--color-stone);
  padding: 8px 12px;
}
.btn-ghost:hover { color: var(--color-pine); }

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

.btn-sm {
  font-size: 0.75rem;
  padding: 8px 14px;
  border-radius: var(--radius-lg);
}

/* ── Icon button ── */
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  transition: background var(--transition-fast);
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--color-stone);
}
.icon-btn:hover { background: rgba(47, 106, 79, 0.08); color: var(--color-pine); }

/* ── Toast ── */
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  max-width: 360px;
  width: calc(100vw - 32px);
  animation: toast-in 0.28s ease-out both;
  pointer-events: auto;
}

.toast-success { background: var(--color-pine); }
.toast-info    { background: #334155; }
.toast-error   { background: #dc2626; }

/* ── Coin badge ── */
.coin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid #fbbf24;
  background: var(--color-gold);
  color: white;
  flex-shrink: 0;
}
.coin-sm  { width: 20px; height: 20px; }
.coin-md  { width: 28px; height: 28px; }
.coin-lg  { width: 48px; height: 48px; }

/* ── Avatar ── */
.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.avatar-sm  { width: 40px; height: 40px; }
.avatar-md  { width: 48px; height: 48px; }
.avatar-lg  { width: 96px; height: 96px; }

.avatar-ring { box-shadow: 0 0 0 2px white; }

.avatar-emerald { background: var(--avatar-emerald-bg); color: var(--avatar-emerald-fg); }
.avatar-indigo  { background: var(--avatar-indigo-bg);  color: var(--avatar-indigo-fg);  }
.avatar-rose    { background: var(--avatar-rose-bg);    color: var(--avatar-rose-fg);    }
.avatar-amber   { background: var(--avatar-amber-bg);   color: var(--avatar-amber-fg);   }
.avatar-sky     { background: var(--avatar-sky-bg);     color: var(--avatar-sky-fg);     }
.avatar-violet  { background: var(--avatar-violet-bg);  color: var(--avatar-violet-fg);  }

/* ── Progress bar ── */
.progress-track {
  height: 10px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-leaf);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill-gold { background: var(--color-gold); }
.progress-fill-indigo { background: #6366f1; }
.progress-track-sm { height: 6px; }
.progress-track-xs { height: 4px; }

/* ── Quest card ── */
.quest-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border-strong);
  padding: var(--space-4) 0;
  text-align: left;
  cursor: pointer;
  transition: opacity var(--transition-fast);
  display: block;
  width: 100%;
}

.quest-card:hover { opacity: 0.8; }

.quest-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-7);
}

.quest-icon {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 16px;
}

.quest-reward {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #92400e;
}

.quest-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-ink);
}

.quest-detail {
  font-size: 0.875rem;
  color: var(--color-stone);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quest-action {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-pine);
  margin-top: var(--space-5);
}

/* ── Pill toggle ── */
.pill-group {
  display: flex;
  background: white;
  border-radius: 16px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.pill-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-stone);
  transition: background var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
}
.pill-btn.active {
  background: var(--color-pine);
  color: white;
}

/* ── Filter chips ── */
.chip-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  background: white;
  color: var(--color-stone);
  transition: background var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
  border: none;
}
.chip.active {
  background: var(--color-pine);
  color: white;
}

/* ── Hero section ── */
.hero-pine {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  background: var(--color-pine);
  color: white;
  padding: var(--space-7) var(--space-7);
}

.hero-pine::before {
  content: '';
  position: absolute;
  right: -40px; top: -80px;
  width: 260px; height: 260px;
  border-radius: 50%;
  border: 38px solid rgba(255,255,255,0.05);
}

.hero-content { position: relative; }

.hero-meta {
  font-size: 0.875rem;
  font-weight: 700;
  color: #6ee7b7;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
  color: white;
}

.hero-body {
  color: rgba(209, 250, 229, 0.8);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: var(--space-4);
  max-width: 520px;
}

/* ── Manna claim button ── */
.claim-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 200px; height: 200px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.claim-btn::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(251, 191, 36, 0.6);
}

.claim-btn:hover:not(:disabled) { transform: scale(1.02); }
.claim-btn:disabled { cursor: default; }

.claim-btn-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.claim-label { font-size: 1.05rem; font-weight: 700; }
.claim-sub   { font-size: 0.875rem; color: #a7f3d0; }

/* ── Leaderboard row ── */
.lb-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid #f1f5f9;
}
.lb-row:last-child { border-bottom: none; }
.lb-row.lb-me { background: #fffbeb; }

.lb-rank {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 900;
  flex-shrink: 0;
}
.lb-rank-top { background: var(--color-gold); color: white; }
.lb-rank-rest { background: #f1f5f9; color: var(--color-stone); }

/* ── Store card ── */
.store-card {
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  transition: transform var(--transition-normal);
}
.store-card:hover { transform: translateY(-2px); }

.store-card-image {
  height: 176px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  transition: transform 0.3s ease;
  background: rgba(0, 0, 0, 0.02) !important;
}
.store-card:hover .store-card-image { transform: scale(1.02); }

.store-card-body { padding: var(--space-4) 0; }

/* ── Badge pill ── */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.badge-pine   { background: rgba(47,106,79,0.1);  color: var(--color-pine); }
.badge-gold   { background: #fef3c7; color: #92400e; }
.badge-leaf   { background: rgba(74,148,105,0.1); color: var(--color-leaf); }

/* ── Section header ── */
.section-header { margin-bottom: var(--space-5); }
.section-header h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-stone);
  transition: color var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.back-link:hover { color: var(--color-pine); }

/* ── Sticky action bar ── */
.sticky-bar {
  position: sticky;
  bottom: 88px;
  z-index: 10;
  background: var(--color-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: flex-start;
}

/* ── Info box ── */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: rgba(47, 106, 79, 0.05);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #374151;
}

.info-box-amber { background: #fffbeb; color: #92400e; }
.info-box-rose  { background: #fff1f2; color: #9f1239; }

/* ── Verse card ── */
.verse-card-pine {
  background: var(--color-pine);
  color: white;
  position: relative;
  min-height: 360px;
  padding: var(--space-8);
  overflow: hidden;
}

.verse-text {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  line-height: 1.55;
  font-style: italic;
}

.verse-reference {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #a7f3d0;
  margin-top: var(--space-6);
}

/* ── Result card ── */
.result-card {
  text-align: center;
  padding: var(--space-10) var(--space-8);
}

.result-icon {
  display: grid;
  place-items: center;
  width: 96px; height: 96px;
  border-radius: 50%;
  margin-inline: auto;
  background: #fef3c7;
  color: var(--color-gold);
}

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--color-border-strong); margin-block: var(--space-7); }

/* ── Reader Swipe Mode ── */
.reader-swipe {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.reader-swipe::-webkit-scrollbar { display: none; }
.reader-swipe > div {
  min-width: 100%;
  scroll-snap-align: start;
  padding-right: 16px; /* spacing between chapters */
}

/* =============================================
   GAMIFICATION & ANIMATIONS
   ============================================= */

/* ── 3D Pushable Button ── */
.btn-3d {
  position: relative;
  transition: all 0.1s ease;
  transform: translateY(0);
}
.btn-3d:active:not(:disabled) {
  transform: translateY(4px);
}

/* ── Animations ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.animate-shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.animate-pop {
  animation: pop 0.3s ease-out;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.animate-pulse-ring {
  animation: pulse-ring 1s infinite;
}

/* Progress bar for quizzes */
.quiz-progress-container {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 16px;
  margin-bottom: 24px;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transition: width 0.3s ease-out;
}

/* ── Menu Link Button ── */
.menu-link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.menu-link-btn:hover {
  background: rgba(0,0,0,0.03);
}

