/* ============================================================
   PTE Mock — Design System Theme
   Built on the TOEFLMock storybook DNA, re-themed for PTE.
   Identity:  IELTS = green · TOEFL = blue/teal · PTE = violet/coral
   Font: Sora · Stack: Tailwind (Play CDN) + these utilities
   ============================================================ */

/* ---------- Base ---------- */
body { font-family: 'Sora', sans-serif; -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }
::selection { background: rgba(109,40,217,0.18); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1eefb; }
::-webkit-scrollbar-thumb { background: #17123a; border-radius: 4px; }

/* ============================================================
   CRITICAL BRAND COLORS
   Applied synchronously so the Tailwind Play CDN JIT delay
   doesn't flash transparent nav/headers on first paint.
   ------------------------------------------------------------
   ink     #17123a   deep indigo — dark base, headings
   brand   #6d28d9   violet — primary
   coral   #ff4d76   accent — CTAs, highlights, "pop"
   gold    #ffc24b   warm secondary
   mint    #16d6a4   positive / success
   muted   #6b6786   secondary text
   lightbg #f6f4ff   tinted page background
   border  #ebe6fb   hairline borders
   ============================================================ */
.bg-ink     { background-color: #17123a; }
.bg-brand   { background-color: #6d28d9; }
.bg-coral   { background-color: #ff4d76; }
.bg-gold    { background-color: #ffc24b; }
.bg-mint    { background-color: #16d6a4; }
.bg-lightbg { background-color: #f6f4ff; }
.text-ink   { color: #17123a; }
.text-brand { color: #6d28d9; }
.text-coral { color: #ff4d76; }
.text-gold  { color: #f59e0b; }
.text-mint  { color: #0f9e7a; }
.text-muted { color: #6b6786; }
.text-white { color: #ffffff; }
.border-border { border-color: #ebe6fb; }

/* ---------- Typography scale ---------- */
.text-hero    { font-size: clamp(40px, 5vw, 74px); line-height: 1.05; letter-spacing: -1.8px; font-weight: 700; }
.text-section { font-size: clamp(30px, 4vw, 50px); line-height: 1.15; letter-spacing: -1px; font-weight: 700; }
.text-sub     { font-size: clamp(20px, 2.5vw, 32px); line-height: 1.3; font-weight: 600; }
.text-stat    { font-size: clamp(36px, 4vw, 56px); line-height: 1.1; font-weight: 700; letter-spacing: -1px; }

/* ---------- Gradient / shine text ---------- */
.gradient-text {
  background: linear-gradient(135deg, #6d28d9, #ff4d76);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.gradient-text-cool {
  background: linear-gradient(135deg, #6d28d9, #16d6a4);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.shine-text {
  background: linear-gradient(100deg, #bfa6ff 0%, #f3a0e6 33%, #ffc2a0 66%, #bfa6ff 100%);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; animation: shine 8s linear infinite;
}

/* Decorative outline text */
.stroke-text {
  -webkit-text-stroke: 1px rgba(255,255,255,0.08); color: transparent;
  font-weight: 700; line-height: 1; white-space: nowrap; user-select: none;
}

/* ---------- Hover utilities ---------- */
.btn-hover { transition: all 0.3s ease; }
.btn-hover:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(109,40,217,0.28); }
.card-hover { transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.card-hover:hover { transform: translateY(-8px); box-shadow: 0 24px 56px rgba(23,18,58,0.14); }
.link-underline { position: relative; }
.link-underline::after {
  content: ''; position: absolute; left: 0; bottom: -3px; height: 2px; width: 0;
  background: #ff4d76; transition: width 0.25s ease;
}
.link-underline:hover::after { width: 100%; }

/* ---------- Avatar stack (social proof) ---------- */
.avatar-stack > * { margin-left: -10px; box-shadow: 0 0 0 2px #17123a; }
.avatar-stack > *:first-child { margin-left: 0; }

/* ---------- Task explorer ---------- */
.skill-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 14px; border: 1px solid transparent;
  transition: all 0.22s cubic-bezier(0.16,1,0.3,1); cursor: pointer; background: transparent;
}
.skill-row:hover { background: #f6f4ff; }
.skill-row.active { background: var(--tint); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.skill-row.active .skill-row-icon { background: var(--accent); color: #fff; }
.skill-row.active .skill-row-name { color: var(--accent); }
.skill-row-icon {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: #f0ecfb; color: #6b6786; flex-shrink: 0; transition: all 0.22s;
}

.task-card {
  position: relative; display: block; width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid #ebe6fb; border-radius: 18px; padding: 20px;
  overflow: hidden; transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), border-color 0.3s, box-shadow 0.35s;
}
.task-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform 0.3s ease;
}
.task-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 22px 44px -18px var(--glow); }
.task-card:hover::before { transform: scaleY(1); }
.task-card:hover .task-go { opacity: 1; transform: translateX(0); }
.task-go { opacity: 0; transform: translateX(-8px); transition: all 0.3s ease; }
.task-meta-icon { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--tint); color: var(--accent); }

/* ---------- Segmented control ---------- */
.seg-track { display: inline-flex; padding: 5px; background: #f0ecfb; border: 1px solid #ebe6fb; border-radius: 14px; gap: 4px; }
.seg-btn { padding: 9px 22px; border-radius: 10px; font-size: 14px; font-weight: 600; color: #6b6786; transition: all 0.2s; cursor: pointer; }
.seg-btn.active { background: #fff; color: #6d28d9; box-shadow: 0 2px 8px rgba(23,18,58,0.10); }

/* ---------- Section card top-borders (PTE skills) ----------
   Speaking = coral · Writing = gold · Reading = violet · Listening = mint */
.section-card-speaking  { border-top: 3px solid #ff4d76; }
.section-card-writing   { border-top: 3px solid #ffc24b; }
.section-card-reading   { border-top: 3px solid #6d28d9; }
.section-card-listening { border-top: 3px solid #16d6a4; }

/* ---------- Surfaces ---------- */
.glass { background: rgba(255,255,255,0.06); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.08); }
.mesh-ink {
  background-color: #17123a;
  background-image:
    radial-gradient(at 12% 18%, rgba(109,40,217,0.55) 0px, transparent 50%),
    radial-gradient(at 85% 8%, rgba(255,77,118,0.35) 0px, transparent 50%),
    radial-gradient(at 78% 92%, rgba(22,214,164,0.28) 0px, transparent 45%);
}
.dotgrid {
  background-image: radial-gradient(rgba(109,40,217,0.14) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ---------- Pills / chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
        padding: 6px 12px; border-radius: 9999px; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes float-bob { 0%,100% { transform: translateY(-10px); } 50% { transform: translateY(6px); } }
@keyframes pulse-dot { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(1.6); } }
@keyframes shine { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
@keyframes timer-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes scroll-left { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes score-fill { 0% { stroke-dashoffset: 283; } }
@keyframes waveform { 0%,100% { height: 4px; } 50% { height: 20px; } }
@keyframes countdown-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(109,40,217,0.35); } 50% { box-shadow: 0 0 0 14px rgba(109,40,217,0); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }

.anim-fade-up    { animation: fadeInUp 0.7s cubic-bezier(0.16,1,0.3,1) both; }
.anim-fade-left  { animation: fadeInLeft 0.7s cubic-bezier(0.16,1,0.3,1) both; }
.anim-fade-right { animation: fadeInRight 0.7s cubic-bezier(0.16,1,0.3,1) both; }
.anim-float      { animation: float-bob 6s ease-in-out infinite; }
.anim-spin-slow  { animation: spin-slow 24s linear infinite; }

/* Reveal-on-scroll (toggled by JS) */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16,1,0.3,1); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Marquee */
.marquee { display: flex; width: max-content; animation: scroll-left 28s linear infinite; }
.marquee:hover { animation-play-state: paused; }

/* ============================================================
   TEST INTERFACE (real-exam look) — Pearson-style neutral chrome
   ============================================================ */
.test-toolbar { display: flex; align-items: center; justify-content: space-between; height: 48px;
  background: #2f3036; color: #fff; padding: 0 16px; font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px; border-radius: 8px 8px 0 0; }
.test-nav { display: flex; align-items: center; justify-content: space-between; height: 52px;
  background: #2f3036; padding: 0 16px; border-radius: 0 0 8px 8px; }
.test-nav-btn { height: 34px; padding: 0 22px; font-size: 13px; font-weight: 600; border: none;
  border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: #fff;
  font-family: "Segoe UI", Arial, sans-serif; }

.test-radio { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 10px 14px;
  border: 1px solid transparent; border-radius: 6px; transition: background 0.12s;
  font-family: "Segoe UI", Arial, sans-serif; font-size: 15px; }
.test-radio:hover { background: #f4f1ff; border-color: #e0d7fb; }
.test-radio-circle { width: 20px; height: 20px; min-width: 20px; border: 2px solid #999; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-top: 1px; flex-shrink: 0; }
.test-radio-circle-inner { width: 10px; height: 10px; border-radius: 50%; }
.test-radio.selected { background: #efe9ff; border-color: #cdbdf5; }
.test-radio.selected .test-radio-circle { border-color: #6d28d9; }
.test-radio.selected .test-radio-circle-inner { background: #6d28d9; }

.test-checkbox-item { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 10px 14px;
  border: 1px solid transparent; border-radius: 6px; transition: background 0.12s;
  font-family: "Segoe UI", Arial, sans-serif; font-size: 15px; }
.test-checkbox-item:hover { background: #f4f1ff; border-color: #e0d7fb; }
.test-checkbox-box { width: 20px; height: 20px; min-width: 20px; border: 2px solid #999; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; margin-top: 1px; flex-shrink: 0; }
.test-checkbox-item.selected .test-checkbox-box { background: #6d28d9; border-color: #6d28d9; }

.review-item { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; border-radius: 6px; color: #fff; cursor: pointer; transition: transform 0.1s;
  font-family: "Segoe UI", Arial, sans-serif; }
.review-item:hover { transform: scale(1.08); }

.waveform-bar { width: 3px; border-radius: 2px; background: #ff4d76; animation: waveform 0.8s ease-in-out infinite; }
.score-ring { animation: score-fill 2s ease-out forwards; }

.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.accordion-content.open { max-height: 600px; }

.toast { background: #17123a; color: #fff; padding: 12px 22px; border-radius: 10px; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(23,18,58,0.28); }
