/* Daily Smart Club Africa — app shell styles.
   Tailwind (pre-compiled, see public/css/tailwind.css) covers most utility
   styling; this file holds the handful of things Tailwind utilities can't
   express: custom gradients, animations, safe-area insets, scroll-snap. */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
  overscroll-behavior-y: none;
  scroll-behavior: smooth;
}

body {
  padding-top: var(--safe-top);
}

/* Bottom nav respects the home-indicator area on notched phones */
.safe-bottom { padding-bottom: var(--safe-bottom); }
.nav-height { height: calc(4.25rem + var(--safe-bottom)); }

/* Hide scrollbars on horizontally swipeable card rows, keep functionality */
.scroll-x-clean { -ms-overflow-style: none; scrollbar-width: none; }
.scroll-x-clean::-webkit-scrollbar { display: none; }

.snap-row { scroll-snap-type: x mandatory; }
.snap-card { scroll-snap-align: start; }

/* Skeleton loading shimmer */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, rgba(148,163,184,.15) 25%, rgba(148,163,184,.3) 37%, rgba(148,163,184,.15) 63%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

/* Gentle entrance animation for screens/cards */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fade-up .3s cubic-bezier(.22,1,.36,1) both; }

/* Staggered card entrance — apply alongside animate-fade-up with an nth-child delay */
.stagger > * { animation: fade-up .35s cubic-bezier(.22,1,.36,1) both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; }

/* Streak flame — bigger, warmer pulse with a subtle glow */
@keyframes flame-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 0 rgba(251,146,60,0)); }
  50% { transform: scale(1.18) rotate(-4deg); filter: drop-shadow(0 0 10px rgba(251,146,60,.7)); }
}
.animate-flame { animation: flame-pulse 1.4s ease-in-out infinite; display: inline-block; }

/* Reward / level-up pop with a little overshoot for punch */
@keyframes pop-in {
  0% { transform: scale(.5) rotate(-6deg); opacity: 0; }
  55% { transform: scale(1.08) rotate(2deg); opacity: 1; }
  80% { transform: scale(.97) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.animate-pop-in { animation: pop-in .45s cubic-bezier(.34,1.56,.64,1) both; }

/* Confetti burst — small colored dots that pop and fall, used on perfect quiz score / level up */
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(70px) rotate(280deg); opacity: 0; }
}
.confetti-piece {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 2px;
  animation: confetti-fall 900ms ease-out forwards;
}

/* Tap feedback — apply to any interactive card/button for a satisfying bouncy press */
.tap-bounce { transition: transform .15s cubic-bezier(.34,1.56,.64,1); }
.tap-bounce:active { transform: scale(.94); }

/* Shimmering glow sweep for the streak/reward banner accent */
@keyframes shine-sweep {
  0% { transform: translateX(-120%) skewX(-15deg); }
  100% { transform: translateX(220%) skewX(-15deg); }
}
.shine-sweep::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.35) 50%, transparent 80%);
  animation: shine-sweep 2.8s ease-in-out infinite;
  animation-delay: 1s;
  pointer-events: none;
}

/* ── Vibrant "Sunset" gradient system ──────────────────────────────────
   Warm, high-energy multi-stop gradients replace the old flat two-tone
   ones — used across the home feed highlight cards and module tiles. */
.grad-sunset  { background-image: linear-gradient(135deg, #f97316 0%, #f43f5e 55%, #d946ef 100%); }
.grad-flame   { background-image: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ef4444 100%); }
.grad-berry   { background-image: linear-gradient(135deg, #db2777 0%, #e11d48 60%, #f43f5e 100%); }
.grad-grape   { background-image: linear-gradient(135deg, #7c3aed 0%, #d946ef 60%, #f472b6 100%); }
.grad-ocean   { background-image: linear-gradient(135deg, #0891b2 0%, #0ea5e9 55%, #38bdf8 100%); }
.grad-forest  { background-image: linear-gradient(135deg, #059669 0%, #10b981 55%, #34d399 100%); }
.grad-gold    { background-image: linear-gradient(135deg, #d97706 0%, #f59e0b 55%, #fbbf24 100%); }
.grad-dusk    { background-image: linear-gradient(135deg, #4338ca 0%, #7c3aed 55%, #d946ef 100%); }

/* Backward-compatible aliases (kept so any older references still resolve) */
.grad-purple { background-image: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%); }
.grad-pink   { background-image: linear-gradient(135deg, #db2777 0%, #f472b6 100%); }
.grad-blue   { background-image: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%); }
.grad-green  { background-image: linear-gradient(135deg, #059669 0%, #34d399 100%); }
.grad-amber  { background-image: linear-gradient(135deg, #d97706 0%, #fbbf24 100%); }
.grad-slate  { background-image: linear-gradient(135deg, #334155 0%, #64748b 100%); }

/* Large, thumb-friendly tap targets everywhere by default */
button, a, .tap-target { min-height: 44px; }

/* Prevent layout shift / white flash while Alpine initializes */
[x-cloak] { display: none !important; }
