/* ============================================================================
   TOEFL Shared CSS — assets/toefl_shared.css
   Counterpart to toefl_shared.js. Loaded globally via
   toefl_enqueue_shared_css() at priority 5, BEFORE skill-specific CSS.

   Canonical prefix decision: tl-*

   v1.2.0 CHANGE — added .tl-btn / .tl-btn-primary as a real shared
   component. Previously these only existed scoped to
   #toefl-listening-app .tl-btn inside toefl_listening.css. Every other
   skill either duplicated that override (Writing, inconsistently) or
   didn't at all (Speaking's entry screen), which is why buttons visibly
   drifted between Reading/Listening vs Speaking vs Writing/Note-taking.
   There is only one theme in this product (dark) — no reason button
   styling should be ID-locked to one skill. Now unscoped, dark by
   default, every skill inherits it automatically.

   SCOPE — this file holds components that are pure markup+CSS with no
   JS-owned rendering: the mode toggle pill, module selection cards, and
   now buttons. Everything else (Results report, Answer Review,
   Explanation/LearnWhy card, Study Plan, Guided Tour) is rendered by
   TOEFL.Results / TOEFL.Review / TOEFL.LearnWhy / TOEFL.Tour in
   toefl_shared.js, which inject their own <style> tags at runtime — not
   duplicated here (see "Embedded CSS for portability" in the Shared JS
   Architecture doc).

   version tag: shared-v1.2.0-css
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,600;0,700;1,800&family=Inter:wght@400;600&display=swap');

/* ============================================================================
   1. BUTTONS
   Unscoped, dark-themed by default — every skill's app container uses
   the same dark UI, so no per-skill override should be needed anymore.
   ============================================================================ */

/* NOTE: .toefl-btn* aliased alongside .tl-btn* — Reading's JS still emits
   the old unprefixed class names (.toefl-btn-primary etc) and hasn't been
   switched to tl-* naming. Rather than risk a JS change, both names get
   identical rules here so Reading matches without touching its JS. */
.tl-btn,
.toefl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 8px;
  border: 1px solid #1B4A7A;
  background: #0A1E3D;
  color: #B8D4FF;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}

.tl-btn:hover,
.toefl-btn:hover {
  border-color: #00AADD;
  color: #00DFFF;
  background: rgba(0, 170, 221, 0.08);
}

.tl-btn:disabled,
.toefl-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tl-btn-primary,
.toefl-btn-primary {
  background: linear-gradient(135deg, #0080CC, #00AADD);
  color: #FFFFFF;
  border: none;
}

.tl-btn-primary:hover:not(:disabled),
.toefl-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0080CC, #00DFFF);
  box-shadow: 0 4px 20px rgba(0, 170, 221, 0.45);
  transform: translateY(-1px);
}

.toefl-btn-secondary {
  background: #0A1E3D;
  color: #B8D4FF;
  border: 1px solid #1B4A7A;
}
.toefl-btn-secondary:hover:not(:disabled) {
  border-color: #00AADD;
  color: #00DFFF;
  background: rgba(0, 170, 221, 0.08);
}

.toefl-btn-text {
  background: transparent;
  color: #00AADD;
  padding: 12px 16px;
  border: none;
}
.toefl-btn-text:hover:not(:disabled) {
  background: rgba(0, 170, 221, 0.1);
  color: #00DFFF;
}

.tl-btn-submit {
  background: #059669;
  border-color: #059669;
  color: #fff;
  padding: 12px 32px;
}
.tl-btn-submit:hover:not(:disabled) { background: #047857; }

/* "Transparent" text-link variant — used for LOGIN, back links, etc.
   Matches the pattern skill JS already uses (inline style="background:transparent") */
.tl-btn[style*="transparent"] {
  background: transparent !important;
  border: none !important;
  color: #00AADD;
}
.tl-btn[style*="transparent"]:hover { color: #00DFFF; background: rgba(0,170,221,0.08) !important; }

/* ============================================================================
   2. MODE TOGGLE PILL
   ============================================================================ */

.tl-mode-toggle {
  position: relative;
  display: flex;
  justify-content: center;
  background: #0A1E3D;
  border: 1px solid #1B4A7A;
  border-radius: 50px;
  padding: 5px;
  margin: 16px auto 24px;
  max-width: 420px;
  width: 100%;
}

.tl-mode-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  background: linear-gradient(135deg, #0080CC, #00DFFF);
  border-radius: 50px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 16px rgba(0, 223, 255, 0.5), 0 0 32px rgba(0, 223, 255, 0.2);
  z-index: 0;
}

.tl-mode-slider.slide-right { transform: translateX(100%); }

.tl-mode-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50px;
}

.tl-mode-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1.5px;
  color: #B8D4FF;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.tl-mode-sub {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #7B9BB8;
  text-align: center;
  transition: color 0.2s ease;
}

.tl-mode-btn--active .tl-mode-title { color: #050C1A; }
.tl-mode-btn--active .tl-mode-sub   { color: #0A2A40; }

.tl-mode-btn--active::before {
  content: '';
  position: absolute;
  top: -3px; right: -3px; bottom: -3px; left: -3px;
  border-radius: 50px;
  border: 1.5px solid rgba(0, 223, 255, 0.6);
  pointer-events: none;
  z-index: 2;
}

/* ============================================================================
   3. LANDING / CTA ROW
   The wrapper + button row pattern every entry screen uses
   (.tl-landing > ... > .tl-cta-buttons). Was previously redeclared
   per-skill (tw-landing, tl-landing duplicated in Speaking/Writing CSS).
   ============================================================================ */

.tl-landing {
  text-align: center;
  padding: 48px 24px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.tl-cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================================
   4. MODULE SELECTION CARDS
   ============================================================================ */

.tl-module-selection {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px;
  animation: tl-entrance 0.4s ease-out both;
}

.tl-module-selection h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 36px;
  letter-spacing: 2px;
  color: #FFFFFF;
  text-align: center;
  margin: 0 0 36px;
}

.tl-module-card-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tl-module-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #0A1E3D;
  border: 1px solid #1B4A7A;
  padding: 24px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
  animation: tl-entrance 0.4s ease-out both;
}

.tl-module-card:nth-child(1) { animation-delay: 0ms;   }
.tl-module-card:nth-child(2) { animation-delay: 80ms;  }
.tl-module-card:nth-child(3) { animation-delay: 160ms; }
.tl-module-card:nth-child(4) { animation-delay: 240ms; }

.tl-module-card:hover {
  border-color: #00AADD;
  background: rgba(0, 170, 221, 0.07);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 170, 221, 0.15);
}

.tl-module-card:focus-visible {
  outline: 2px solid #00AADD;
  outline-offset: 3px;
}

.tl-module-card-icon  { font-size: 36px; flex-shrink: 0; line-height: 1; margin-right: 4px; }

.tl-module-card-title {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 1px;
  color: #FFFFFF;
  margin-bottom: 6px;
  line-height: 1.2;
}

.tl-module-card-desc {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #B8D4FF;
  line-height: 1.5;
}

.tl-module-card-meta {
  font-size: 11px;
  color: rgba(184,212,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tl-module-card-cta {
  margin-left: 20px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: #00AADD;
  flex-shrink: 0;
  white-space: nowrap;
  transition: color 0.15s ease, transform 0.15s ease;
}

.tl-module-card:hover .tl-module-card-cta {
  color: #00DFFF;
  transform: translateX(4px);
}

/* ============================================================================
   5. PAGE HERO — for the manually-built Elementor headline block at the
   top of each ability page (TOEFL Reading Lab / Listening Lab / etc).
   This is NOT rendered by any skill JS — it's pasted as a small HTML
   snippet into each page's Elementor HTML widget. Defining it once here
   (already loaded globally on every page) means the HTML snippet per
   page only needs markup + content, never its own <style> block.
   ============================================================================ */

.tl-page-hero {
  position: relative;
  text-align: center;
  padding: 56px 24px 40px;
  overflow: hidden;
}

/* Soft ambient glow blob behind the title — brand guide motion token
   "Ambient glow: scale 1 → 1.08 → 1, 4s ease-in-out, infinite" */
.tl-page-hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 520px;
  height: 520px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 170, 221, 0.22) 0%, rgba(0, 170, 221, 0) 70%);
  animation: tl-hero-glow 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes tl-hero-glow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%       { transform: translate(-50%, -50%) scale(1.08); }
}

.tl-page-hero-badge {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #00DFFF;
  background: rgba(0, 223, 255, 0.08);
  border: 1px solid rgba(0, 223, 255, 0.25);
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.tl-page-hero h1 {
  position: relative;
  z-index: 1;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-style: italic;
  font-size: clamp(34px, 6vw, 56px);
  letter-spacing: 1px;
  line-height: 1.05;
  margin: 0 0 18px;
}

/* "TOEFL" — brand guide's official wordmark gradient */
.tl-page-hero-brand {
  background: linear-gradient(135deg, #FFFFFF 0%, #B8D4FF 45%, #00C8FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(0, 180, 255, 0.55));
}

/* Ability name — Signal Blue → Cyan Flash, always gradient, always glowing.
   This replaces any flat/solid color version (e.g. Listening's old
   plain cyan) so every ability page gets the same premium treatment. */
.tl-page-hero-ability {
  background: linear-gradient(135deg, #00AADD 0%, #00DFFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 16px rgba(0, 223, 255, 0.6));
}

.tl-page-hero p {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #B8D4FF;
}

@media (max-width: 600px) {
  .tl-page-hero { padding: 40px 16px 28px; }
  .tl-page-hero::before { width: 360px; height: 360px; }
}

/* ============================================================================
   6. HOME NAV CARDS — vertical card grid for the homepage's practice
   section. Contained panel (subtle gradient, not pure black) + 2-col
   grid of cards with icon/title/desc/meta, sky-blue glow on hover.
   ============================================================================ */

.tl-home-nav-panel {
  background: linear-gradient(180deg, rgba(10, 30, 61, 0.5) 0%, rgba(10, 30, 61, 0.15) 100%);
  border-top: 1px solid rgba(0, 170, 221, 0.15);
  padding: 56px 24px 72px;
}

.tl-nav-eyebrow {
  text-align: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(184, 212, 255, 0.55);
  margin: 0 0 28px;
}

.tl-home-nav-grid {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.tl-home-nav-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: #0A1E3D;
  border: 1px solid #1B4A7A;
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  animation: tl-entrance 0.4s ease-out both;
}

.tl-home-nav-card:nth-child(1) { animation-delay: 0ms;   }
.tl-home-nav-card:nth-child(2) { animation-delay: 60ms;  }
.tl-home-nav-card:nth-child(3) { animation-delay: 120ms; }
.tl-home-nav-card:nth-child(4) { animation-delay: 180ms; }
.tl-home-nav-card:nth-child(5) { animation-delay: 240ms; }

.tl-home-nav-card:hover {
  border-color: #00DFFF;
  background: rgba(0, 223, 255, 0.09);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 223, 255, 0.18);
}

.tl-home-nav-icon {
  font-size: 30px;
  line-height: 1;
}

.tl-home-nav-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.5px;
  color: #FFFFFF;
}

.tl-home-nav-desc {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #B8D4FF;
}

.tl-home-nav-meta {
  margin-top: 4px;
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #00DFFF;
  background: rgba(0, 223, 255, 0.1);
  border: 1px solid rgba(0, 223, 255, 0.25);
  padding: 3px 10px;
  border-radius: 10px;
}

.tl-home-nav-card:nth-child(5) {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}
.tl-home-nav-card:nth-child(5) .tl-home-nav-icon { font-size: 26px; }

@media (max-width: 640px) {
  .tl-home-nav-grid { grid-template-columns: 1fr; }
  .tl-home-nav-card:nth-child(5) { grid-column: auto; flex-direction: column; align-items: flex-start; }
  .tl-home-nav-panel { padding: 40px 16px 56px; }
}

/* ============================================================================
   7. SHARED MOTION + RESPONSIVE
   ============================================================================ */

@keyframes tl-entrance {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .tl-module-selection { padding: 32px 16px; }
  .tl-module-selection h2 { font-size: 28px; }
  .tl-module-card { padding: 18px 16px; gap: 14px; }
  .tl-module-card-title { font-size: 19px; }
}

@media (max-width: 600px) {
  .tl-module-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 12px;
    align-items: center;
  }
  .tl-module-card-icon  { grid-column: 1; grid-row: 1 / 3; align-self: center; font-size: 28px; margin-right: 0; }
  .tl-module-card-title { grid-column: 2; grid-row: 1; font-size: 17px; margin-bottom: 0; }
  .tl-module-card-desc  { grid-column: 2; grid-row: 2; font-size: 12px; }
  .tl-module-card-cta   { grid-column: 3; grid-row: 1 / 3; align-self: center; display: block !important; margin-left: 8px; font-size: 16px; }

  .tl-cta-buttons { flex-direction: column; align-items: center; width: 100%; }
  .tl-cta-buttons .tl-btn { width: 100%; max-width: 300px; }
}

@media (max-width: 480px) {
  .tl-module-card-cta { display: none; }
}