/* =====================================================================
   coach-brand.css — verbatim design tokens & components from index.html
   Used by _CoachLayout.cshtml so the AI Voice Coach learner pages
   pixel-match the gamified BolEnglish landing page (index.html).
   Pair with Tailwind Play CDN + Fredoka/Inter/Caveat fonts + Lucide.
   ===================================================================== */

/* ---------- DESIGN TOKENS ---------- */
:root {
  --primary-purple:  #7c3aed;
  --electric-blue:   #3b82f6;
  --sunshine-yellow: #fbbf24;
  --mint-fresh:      #10b981;
  --coral-pop:       #f97316;
  --pink-playful:    #ec4899;
  --lavender-soft:   #a78bfa;
  --sky-light:       #0ea5e9;

  --bg:          #fafaff;
  --bg-soft:     #f3f0ff;
  --surface:     #ffffff;
  --text:        #1f1b3a;
  --text-muted:  #5b5878;
  --border:      rgba(124,58,237,0.12);
  --shadow-lg:   0 20px 50px -12px rgba(124,58,237,0.25);
  --shadow-md:   0 8px 24px -8px rgba(124,58,237,0.18);
}
html[data-theme="dark"] {
  --bg:          #0d0a1f;
  --bg-soft:     #151030;
  --surface:     #1a1540;
  --text:        #f1efff;
  --text-muted:  #a8a2c9;
  --border:      rgba(167,139,250,0.18);
  --shadow-lg:   0 20px 50px -12px rgba(0,0,0,0.5);
  --shadow-md:   0 8px 24px -8px rgba(0,0,0,0.4);
}

* { -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}
h1, h2, h3, h4, .display {
  font-family: 'Fredoka', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
}
.handwrite { font-family: 'Caveat', cursive; }

/* ---------- ANIMATED MESH GRADIENT BG ---------- */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(at 15% 20%, rgba(124,58,237,0.25) 0px, transparent 50%),
    radial-gradient(at 85% 10%, rgba(236,72,153,0.20) 0px, transparent 50%),
    radial-gradient(at 75% 80%, rgba(59,130,246,0.22) 0px, transparent 50%),
    radial-gradient(at 10% 90%, rgba(251,191,36,0.18) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(16,185,129,0.12) 0px, transparent 50%);
  animation: meshShift 18s ease-in-out infinite alternate;
}
html[data-theme="dark"] .mesh-bg {
  opacity: 0.55;
}
@keyframes meshShift {
  0%   { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.15) rotate(6deg); }
}

/* Floating blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
  animation: floaty 12s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(30px,-40px) scale(1.1); }
}

/* ---------- GLASS CARDS ---------- */
.glass {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.glass-strong {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border);
}

/* Gradient border effect */
.gradient-border {
  position: relative;
  background: var(--surface);
}
.gradient-border::before {
  content: "";
  position: absolute; inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary-purple), var(--pink-playful), var(--electric-blue));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/* ---------- NAV ---------- */
.nav-link {
  position: relative;
  padding: 0.5rem 0.25rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--primary-purple); }
.nav-link.active { color: var(--primary-purple); }
.nav-link::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--primary-purple), var(--pink-playful));
  transition: width 0.25s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-link.active::after { width: 100%; }

/* ---------- BUTTONS ---------- */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-purple), var(--pink-playful));
  color: #fff;
  padding: 0.9rem 1.8rem;
  border-radius: 14px;
  font-weight: 600;
  box-shadow: 0 8px 22px -8px rgba(124,58,237,0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 30px -10px rgba(236,72,153,0.65);
}
.btn-ghost {
  padding: 0.9rem 1.6rem;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-ghost:hover {
  border-color: var(--primary-purple);
  color: var(--primary-purple);
  transform: translateY(-2px);
}

/* ---------- HERO MASCOT ---------- */
.mascot {
  animation: bob 4s ease-in-out infinite;
  filter: drop-shadow(0 20px 30px rgba(124,58,237,0.35));
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-20px) rotate(2deg); }
}
.blink {
  animation: blink 4s infinite;
  transform-origin: center;
}
@keyframes blink {
  0%, 45%, 50%, 100% { transform: scaleY(1); }
  47%                 { transform: scaleY(0.1); }
}

/* ---------- TYPEWRITER ---------- */
.typewriter {
  display: inline-block;
  border-right: 3px solid var(--primary-purple);
  white-space: nowrap;
  overflow: hidden;
  animation: type 3.5s steps(40, end) 0.3s 1 normal both, caret 0.75s step-end infinite;
}
@keyframes type { from { width: 0 } to { width: 100% } }
@keyframes caret {
  50% { border-right-color: transparent; }
}

/* ---------- SKILL CARDS ---------- */
.skill-card {
  position: relative;
  border-radius: 22px;
  padding: 1.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s;
}
.skill-card::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--card-grad);
  opacity: 0.12;
  transition: opacity 0.35s;
}
.skill-card:hover { transform: translateY(-8px) scale(1.01); }
.skill-card:hover::before { opacity: 0.22; }
.skill-card:hover .skill-glow {
  opacity: 1; transform: scale(1.2);
}
.skill-glow {
  position: absolute;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: var(--card-grad);
  filter: blur(40px);
  opacity: 0.4;
  top: -40px; right: -40px;
  transition: all 0.4s;
}
.skill-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: var(--card-grad);
  color: #fff;
  box-shadow: 0 10px 20px -8px var(--card-shadow);
}

/* Module color themes */
.m-grammar   { --card-grad: linear-gradient(135deg, #7c3aed, #a78bfa); --card-shadow: rgba(124,58,237,0.5); }
.m-reading   { --card-grad: linear-gradient(135deg, #3b82f6, #0ea5e9); --card-shadow: rgba(59,130,246,0.5); }
.m-writing   { --card-grad: linear-gradient(135deg, #f97316, #fb923c); --card-shadow: rgba(249,115,22,0.5); }
.m-speaking  { --card-grad: linear-gradient(135deg, #ec4899, #f472b6); --card-shadow: rgba(236,72,153,0.5); }
.m-listening { --card-grad: linear-gradient(135deg, #10b981, #34d399); --card-shadow: rgba(16,185,129,0.5); }
.m-vocab     { --card-grad: linear-gradient(135deg, #fbbf24, #fcd34d); --card-shadow: rgba(251,191,36,0.5); }
.m-phonetics { --card-grad: linear-gradient(135deg, #0d9488, #14b8a6, #5eead4); --card-shadow: rgba(20,184,166,0.5); }

/* ---------- PROGRESS RING ---------- */
.ring-track { stroke: var(--border); }
.ring-fill {
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  stroke-linecap: round;
}

/* ---------- REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in {
  opacity: 1; transform: translateY(0);
}

/* ---------- FAQ ---------- */
.faq-item[open] .faq-chev { transform: rotate(180deg); }
.faq-chev { transition: transform 0.3s; }

/* ---------- UTILITIES ---------- */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-purple), var(--pink-playful), var(--electric-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ---------- NAV DROPDOWN (Skills) ---------- */
.navdrop { position: relative; }
.navdrop-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  padding-top: 10px; display: none; z-index: 60; min-width: 200px;
}
.navdrop:hover .navdrop-menu, .navdrop:focus-within .navdrop-menu { display: block; }
.navdrop-menu > a {
  display: block; padding: 0.55rem 1rem; font-size: 0.875rem; font-weight: 500;
  color: var(--text); background: var(--surface);
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.navdrop-menu > a:first-child { border-top: 1px solid var(--border); border-radius: 14px 14px 0 0; }
.navdrop-menu > a:last-child { border-bottom: 1px solid var(--border); border-radius: 0 0 14px 14px; box-shadow: var(--shadow-md); }
.navdrop-menu > a:hover { background: var(--bg-soft); color: var(--primary-purple); }

/* Right-aligned variant (account menu) + logout form row */
.navdrop-right { left: auto; right: 0; transform: none; }
.navdrop-form { margin: 0; }
.navdrop-form > button {
  display: block; width: 100%; text-align: left; padding: 0.55rem 1rem;
  font-size: 0.875rem; font-weight: 500; color: #dc2626; background: var(--surface);
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border); border-radius: 0 0 14px 14px; box-shadow: var(--shadow-md);
  cursor: pointer;
}
.navdrop-form > button:hover { background: rgba(220,38,38,0.08); }
/* when a form is last, the preceding <a> should not round its corners */
.navdrop-menu > a:last-of-type { border-radius: 0; border-bottom: none; box-shadow: none; }
.navdrop-menu > a:only-of-type, .navdrop-menu:not(:has(.navdrop-form)) > a:last-of-type { border-bottom: 1px solid var(--border); border-radius: 0 0 14px 14px; box-shadow: var(--shadow-md); }

/* ---------- FLAME STREAK ---------- */
.flame {
  display: inline-block;
  animation: flicker 1.5s infinite alternate;
  filter: drop-shadow(0 0 8px rgba(249,115,22,0.6));
}
@keyframes flicker {
  0%   { transform: scale(1) rotate(-3deg); }
  100% { transform: scale(1.08) rotate(3deg); }
}

/* ---------- CAROUSEL ---------- */
.carousel { scroll-snap-type: x mandatory; }
.carousel > * { scroll-snap-align: start; }
.carousel::-webkit-scrollbar { height: 6px; }
.carousel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

/* ---------- MOBILE MENU ---------- */
#mobileMenu {
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
}
#mobileMenu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ---------- MOBILE REFINEMENTS ---------- */
@media (max-width: 640px) {
  /* Tighter nav */
  header nav.glass-strong { width: calc(100% - 1rem) !important; margin-top: 0.5rem; padding: 0.6rem 0.85rem !important; border-radius: 16px; }

  /* Hero banners: less padding, smaller type */
  main .rounded-3xl.shadow-glow { padding: 1.4rem !important; }
  main h1 { font-size: clamp(1.5rem, 7vw, 1.9rem) !important; line-height: 1.15; }
  main .text-7xl { font-size: 3.2rem !important; }
  main .text-6xl { font-size: 2.6rem !important; }
  main .text-5xl { font-size: 2.2rem !important; }

  /* Hero stat rows wrap nicely */
  main .text-3xl.font-bold { font-size: 1.4rem !important; }

  /* Comfortable tap targets */
  .btn-primary, .btn-ghost, .vc-recbtn, button[type="submit"] { min-height: 44px; }
  .chipbtn, .qchip, .pick-chip, .tone-chip { padding: 0.5rem 1rem; }

  /* Cards breathe less on small screens */
  .card { border-radius: 1rem; }

  /* Stop decorative blobs from causing sideways scroll */
  .blob { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Prevent horizontal scroll from decorative blobs */
html, body { overflow-x: hidden; max-width: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary-purple), var(--pink-playful));
  border-radius: 999px;
}

/* Inter for headings (matches index.html override) */
h1,h2,h3,h4,h5,h6,.display{font-family:'Inter',system-ui,sans-serif !important;letter-spacing:normal !important;}

/* =====================================================================
   COMPATIBILITY SHIMS
   The Voice Coach pages were authored with the app.css token vocabulary
   (card / text-ink / bg-canvas-soft / bg-brand-gradient / learn-display
   / chip-green ...). _CoachLayout does NOT load app.css, so these shims
   map those classes onto index.html's exact brand system. This lets the
   Coach pages pixel-match index.html with no markup churn.
   ===================================================================== */

/* Glass card — same translucent look as index.html .glass */
.card {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: 1.25rem;
}

/* Text + surface tokens */
.text-ink        { color: var(--text); }
.text-ink-muted  { color: var(--text-muted); }
.bg-surface      { background: var(--surface); }
.bg-canvas       { background: var(--bg); }
.bg-canvas-soft  { background: var(--bg-soft); }
.border-line     { border-color: var(--border); }
.divide-line > :not([hidden]) ~ :not([hidden]) { border-color: var(--border) !important; }

/* Brand accents */
.text-brand-400, .text-brand-500, .text-brand-600 { color: var(--primary-purple); }
.hover\:text-brand-400:hover,
.hover\:text-brand-500:hover,
.hover\:text-brand-600:hover { color: var(--pink-playful); }

/* Brand gradient (hero banners + progress fills) */
.bg-brand-gradient { background: linear-gradient(135deg, var(--primary-purple), var(--pink-playful)); }

/* Radius + glow helpers */
.rounded-brand { border-radius: 14px; }
.shadow-glow   { box-shadow: 0 18px 40px -12px rgba(124,58,237,0.45); }

/* Fredoka/Inter display headings (index.html forces Inter) */
.learn-display { font-family: 'Inter', system-ui, sans-serif; letter-spacing: normal; }

/* Chip colour variants (index.html applies colour to .chip) */
.chip-green   { background: rgba(16,185,129,0.14);  color: #047857; }
.chip-amber   { background: rgba(251,191,36,0.16);  color: #b45309; }
.chip-red     { background: rgba(239,68,68,0.14);   color: #b91c1c; }
.chip-purple  { background: rgba(124,58,237,0.12);  color: var(--primary-purple); }
.chip-blue    { background: rgba(59,130,246,0.14);  color: #1d4ed8; }
.chip-neutral { background: var(--bg-soft);         color: var(--text-muted); }

/* =====================================================================
   VOICE COACH — modern/engaging upgrades
   ===================================================================== */

/* Clickable cards lift like index.html skill cards */
a.card { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s; }
a.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

/* Pulsing ring while recording */
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.55); }
  50%      { box-shadow: 0 0 0 14px rgba(220,38,38,0); }
}
.vc-recbtn.recording { animation: recPulse 1.4s ease-out infinite; }

/* ---------- ANALYSIS LOADING OVERLAY ---------- */
.vc-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}
.vc-overlay.hidden { display: none; }
.vc-overlay-card {
  width: min(92vw, 430px);
  border-radius: 26px;
  padding: 2.1rem 1.9rem 1.7rem;
  text-align: center;
  animation: vcPop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes vcPop { from { opacity: 0; transform: scale(0.92) translateY(14px); } to { opacity: 1; transform: none; } }

.vc-pulse-wrap { position: relative; width: 90px; height: 90px; margin: 0 auto 1.1rem; }
.vc-pulse-mic {
  position: absolute; inset: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 2.1rem; color: #fff;
  background: linear-gradient(135deg, var(--primary-purple), var(--pink-playful));
  box-shadow: 0 14px 30px -10px rgba(124,58,237,0.55);
  animation: vcBreathe 2.2s ease-in-out infinite;
}
@keyframes vcBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.vc-ripple {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--primary-purple);
  animation: vcRipple 1.9s ease-out infinite;
}
@keyframes vcRipple { from { transform: scale(1); opacity: 0.55; } to { transform: scale(2); opacity: 0; } }

.vc-progress {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--bg-soft);
  margin: 1.1rem 0 1.3rem;
}
.vc-progress-bar {
  height: 100%; width: 0%; border-radius: 999px; position: relative;
  background: linear-gradient(90deg, var(--primary-purple), var(--pink-playful));
  transition: width 0.45s ease;
}
.vc-progress-bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: vcShimmer 1.3s linear infinite;
}
@keyframes vcShimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.vc-steps { display: flex; flex-direction: column; gap: 0.3rem; text-align: left; }
.vc-step {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.5rem 0.7rem; border-radius: 12px;
  font-size: 0.875rem; color: var(--text-muted);
  transition: background 0.3s, color 0.3s;
}
.vc-step .vc-step-ic { width: 1.5rem; text-align: center; filter: grayscale(1); opacity: 0.55; transition: filter 0.3s, opacity 0.3s; }
.vc-step .vc-step-state { margin-left: auto; width: 16px; height: 16px; display: grid; place-items: center; }
.vc-step.active {
  background: rgba(124,58,237,0.09);
  color: var(--text); font-weight: 600;
}
.vc-step.active .vc-step-ic { filter: none; opacity: 1; }
.vc-step.active .vc-step-state::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--primary-purple); border-top-color: transparent;
  animation: vcSpin 0.7s linear infinite; display: block;
}
@keyframes vcSpin { to { transform: rotate(360deg); } }
.vc-step.done { color: var(--mint-fresh); }
.vc-step.done .vc-step-ic { filter: none; opacity: 1; }
.vc-step.done .vc-step-state::after { content: "✓"; font-weight: 700; color: var(--mint-fresh); }

.vc-tip { margin-top: 1.1rem; font-size: 0.78rem; color: var(--text-muted); min-height: 2.2em; transition: opacity 0.3s; }

