/* ==========================================================================
   Synapse — synapseko.com
   Dark theme, brand colors, mobile-first responsive
   ========================================================================== */

/* ---------- Reset & Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #FFFFFF;
  background-color: #0F1F33;
  background-image: url('../assets/backgrounds/background-neural-desktop.png');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  min-height: 100vh;
}

a {
  color: #4169E1;
  text-decoration: none;
}

a:hover {
  color: #5A7FE8;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

.section-title {
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 2rem 2rem;
  position: relative;
}

.hero-content {
  max-width: 640px;
  margin-bottom: 2rem;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #FFFFFF 0%, #E8A0B0 50%, #FFD700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

/* ---------- Hero Video ---------- */

.hero-video-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.hero-video-container video {
  width: 100%;
  display: block;
  border-radius: 0 0 16px 16px;
}

/* ---------- Hero Video Title Bar (globe + flag) ---------- */

.hero-video-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 31, 51, 0.9);
  border-radius: 16px 16px 0 0;
}

.hero-bar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #FFFFFF;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-bar-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.hero-bar-icon {
  width: 20px;
  height: 20px;
}

.hero-flag-selector {
  position: relative;
}

.hero-flag-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

/* ---------- Hero Flag Dropdown ---------- */

.hero-flag-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 260px;
  max-height: 360px;
  overflow-y: auto;
  background: rgba(15, 31, 51, 0.97);
  border: 1px solid rgba(65, 105, 225, 0.25);
  border-radius: 12px;
  padding: 0.5rem 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.hero-flag-dropdown[hidden] {
  display: none;
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 1rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.lang-dropdown-item:hover {
  background: rgba(65, 105, 225, 0.15);
  color: #FFFFFF;
}

.lang-dropdown-item.active {
  background: rgba(65, 105, 225, 0.2);
  color: #FFFFFF;
  font-weight: 600;
}

.dropdown-flag {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.dropdown-name {
  flex: 1;
  min-width: 0;
}

.dropdown-has-video {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4169E1;
}

/* ---------- Card Language Badge ---------- */

.card-lang-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(30, 58, 95, 0.6);
  border: 1px solid rgba(65, 105, 225, 0.15);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.15s;
  margin-top: 0.375rem;
}

.card-lang-badge:hover {
  background: rgba(30, 58, 95, 0.8);
}

.card-lang-badge .badge-flag {
  font-size: 0.875rem;
}

.card-lang-badge .badge-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.5;
}

.card-lang-dropdown {
  position: absolute;
  bottom: calc(100% + 0.25rem);
  left: 0;
  min-width: 180px;
  background: rgba(15, 31, 51, 0.97);
  border: 1px solid rgba(65, 105, 225, 0.25);
  border-radius: 8px;
  padding: 0.375rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.card-lang-dropdown[hidden] {
  display: none;
}

.card-narration-indicator {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.25rem;
}

/* ---------- Map Modal ---------- */

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.map-modal[hidden] {
  display: none;
}

.map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.map-modal-content {
  position: relative;
  width: 100%;
  max-width: 1000px;
  background: #0F1F33;
  border-radius: 16px;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
}

.map-modal-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.map-modal-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.5rem;
}

.map-container {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto 2rem;
}

.map-container svg {
  width: 100%;
  height: auto;
  touch-action: none;
}

/* ---------- Map Zoom Reset Button ---------- */

.map-zoom-reset {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  z-index: 5;
  padding: 0.375rem 0.75rem;
  background: rgba(15, 31, 51, 0.9);
  border: 1px solid rgba(65, 105, 225, 0.3);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.map-zoom-reset:hover {
  background: rgba(30, 58, 95, 0.9);
  color: #FFFFFF;
}

.map-zoom-reset[hidden] {
  display: none;
}

/* ---------- Map Tooltip ---------- */

.map-tooltip {
  position: fixed;
  z-index: 1100;
  pointer-events: none;
  background: rgba(15, 31, 51, 0.95);
  border: 1px solid rgba(65, 105, 225, 0.3);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.8125rem;
  color: #FFFFFF;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.map-tooltip[hidden] {
  display: none;
}

.map-tooltip-lang {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
}

.map-tooltip-dim {
  color: rgba(255, 255, 255, 0.4);
}

.map-tooltip-unsupported {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Country styling via JS — base styles */
.map-container .country {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 0.5;
  transition: fill 0.15s, stroke 0.15s;
  cursor: default;
}

.map-container .country.supported {
  cursor: pointer;
}

.map-container .country.supported:hover {
  filter: brightness(1.3);
}

.map-container .country.selected {
  stroke: #FFD700;
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.4));
}

/* ---------- Flag Grid (Mobile) ---------- */

.flag-grid {
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.flag-grid .flag-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 12px;
  transition: background 0.15s;
}

.flag-grid .flag-item:hover {
  background: rgba(65, 105, 225, 0.15);
}

.flag-grid .flag-item.selected {
  background: rgba(255, 215, 0, 0.15);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.4);
}

.flag-grid .flag-emoji {
  font-size: 2rem;
  line-height: 1;
}

.flag-grid .flag-label {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

/* ---------- Selected Language ---------- */

.selected-language {
  text-align: center;
  padding: 1rem;
  background: rgba(65, 105, 225, 0.1);
  border: 1px solid rgba(65, 105, 225, 0.2);
  border-radius: 12px;
  max-width: 400px;
  margin: 0 auto;
}

.selected-language-label {
  color: rgba(255, 255, 255, 0.6);
  margin-right: 0.5rem;
}

/* ---------- Lessons ---------- */

.lessons-section {
  padding: 4rem 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.lessons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.lesson-card {
  background: rgba(30, 58, 95, 0.5);
  border: 1px solid rgba(65, 105, 225, 0.15);
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.lesson-card:hover {
  background: rgba(30, 58, 95, 0.7);
  border-color: rgba(65, 105, 225, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(65, 105, 225, 0.15);
}

.lesson-card-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(65, 105, 225, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: #4169E1;
}

.lesson-card-body {
  flex: 1;
  min-width: 0;
}

.lesson-card-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
  color: #FFFFFF;
}

.lesson-card-meta {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

.lesson-card-play {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(65, 105, 225, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.lesson-card:hover .lesson-card-play {
  background: rgba(65, 105, 225, 0.5);
}

.lesson-card-play svg {
  width: 16px;
  height: 16px;
  fill: #FFFFFF;
  margin-left: 2px;
}

.lesson-card-unavailable {
  opacity: 0.4;
  cursor: default;
}

.lesson-card-unavailable:hover {
  transform: none;
  box-shadow: none;
  background: rgba(30, 58, 95, 0.5);
  border-color: rgba(65, 105, 225, 0.15);
}

/* ---------- Target Language Tabs ---------- */

.target-lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.target-lang-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.25rem;
  background: rgba(30, 58, 95, 0.4);
  border: 1px solid rgba(65, 105, 225, 0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  color: #FFFFFF;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
}

.target-lang-item:hover {
  background: rgba(30, 58, 95, 0.7);
  border-color: rgba(65, 105, 225, 0.35);
  transform: translateY(-2px);
}

.target-lang-item.selected {
  background: rgba(255, 215, 0, 0.12);
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.2);
}

.target-lang-item .flag-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

/* ---------- Target Lessons Sub-section ---------- */

#target-lessons {
  margin-top: 1.5rem;
}

.target-lessons-heading {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

/* ---------- Video Modal ---------- */

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.video-modal[hidden] {
  display: none;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.video-modal-content {
  position: relative;
  width: 100%;
  max-width: 900px;
  background: #0F1F33;
  border-radius: 16px;
  overflow: hidden;
}

.video-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #FFFFFF;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.video-modal-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.video-modal video {
  width: 100%;
  display: block;
}

.video-modal-title {
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- App Download Card (between lessons) ---------- */

.app-download-card {
  background: linear-gradient(135deg, rgba(65, 105, 225, 0.15) 0%, rgba(232, 160, 176, 0.1) 100%);
  border: 1px solid rgba(65, 105, 225, 0.25);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
}

.app-download-card-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.app-download-card-features {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.app-download-card-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* =============================================================================
   APP DOWNLOAD SECTION (persistent, between lessons and footer)
   ============================================================================= */

.app-section {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 720px;
  margin: 0 auto;
}

.app-section-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ---------- Store Badges (shared) ---------- */

.store-badge {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #FFFFFF;
  transition: background 0.2s, transform 0.15s;
}

.store-badge:hover {
  color: #FFFFFF;
  transform: translateY(-1px);
}

.store-badge-ios {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.store-badge-ios:hover {
  background: #1a1a1a;
}

.store-badge-android {
  background: #01875f;
  border: 1px solid rgba(1, 135, 95, 0.5);
}

.store-badge-android:hover {
  background: #01a270;
}

/* ---------- Post-Video CTA ---------- */

.video-end-cta {
  position: absolute;
  inset: 0;
  background: rgba(15, 31, 51, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.video-end-cta[hidden] {
  display: none;
}

.video-end-cta-content {
  text-align: center;
  padding: 2rem;
  max-width: 480px;
}

.video-end-cta-headline {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.video-end-cta-subtext {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.video-end-cta-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.video-end-cta-dismiss {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.15s;
}

.video-end-cta-dismiss:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ---------- Android Smart Banner ---------- */

.android-app-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: 56px;
  background: #1E3A5F;
  border-bottom: 1px solid rgba(65, 105, 225, 0.2);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
}

.has-android-banner {
  padding-top: 56px;
}

.android-app-banner-content {
  flex: 1;
  min-width: 0;
}

.android-app-banner-name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  color: #FFFFFF;
  display: block;
}

.android-app-banner-text {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.android-app-banner-cta {
  flex-shrink: 0;
  padding: 0.375rem 1rem;
  background: #4169E1;
  border-radius: 6px;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
}

.android-app-banner-cta:hover {
  background: #5A7FE8;
  color: #FFFFFF;
}

.android-app-banner-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

/* ---------- Sticky Mobile Bar ---------- */

.sticky-mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: 52px;
  background: #1E3A5F;
  border-top: 1px solid rgba(65, 105, 225, 0.2);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
}

.has-sticky-bar {
  padding-bottom: 52px;
}

.sticky-mobile-bar-text {
  flex: 1;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.85);
}

.sticky-mobile-bar-cta {
  flex-shrink: 0;
  padding: 0.375rem 1.25rem;
  background: #4169E1;
  border-radius: 6px;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
}

.sticky-mobile-bar-cta:hover {
  background: #5A7FE8;
  color: #FFFFFF;
}

.sticky-mobile-bar-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

/* ---------- Footer ---------- */

.footer {
  padding: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 4rem;
}

.footer-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8125rem;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: rgba(255, 255, 255, 0.8);
}

.footer-language-select {
  background: rgba(30, 58, 95, 0.5);
  border: 1px solid rgba(65, 105, 225, 0.2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: #FFFFFF;
  font-size: 0.875rem;
  cursor: pointer;
}

.footer-language-select option {
  background: #1E3A5F;
  color: #FFFFFF;
}

/* ---------- RTL Support ---------- */

html[dir="rtl"] .selected-language-label {
  margin-right: 0;
  margin-left: 0.5rem;
}

html[dir="rtl"] .lesson-card {
  flex-direction: row-reverse;
}

html[dir="rtl"] .lesson-card-play svg {
  margin-left: 0;
  margin-right: 2px;
}

html[dir="rtl"] .hero-video-bar {
  flex-direction: row-reverse;
}

html[dir="rtl"] .hero-flag-dropdown {
  right: 0;
  left: auto;
}

html[dir="rtl"] .lang-dropdown-item {
  text-align: right;
}

html[dir="rtl"] .card-lang-dropdown {
  left: auto;
  right: 0;
}

html[dir="rtl"] .footer-content {
  flex-direction: row-reverse;
}

/* ---------- Legal Pages ---------- */

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem;
}

.legal-page h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.legal-page .legal-date {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #4169E1;
}

.legal-page p,
.legal-page li {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.legal-page ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-page a {
  color: #4169E1;
}

.legal-back {
  display: inline-block;
  padding: 1rem 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

.legal-back:hover {
  color: #FFFFFF;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Small phones */
@media (max-width: 480px) {
  .hero {
    padding: 2rem 1rem 1.5rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-tagline {
    font-size: 1.05rem;
  }

  .hero-video-container {
    border-radius: 12px;
  }

  .hero-video-bar {
    border-radius: 12px 12px 0 0;
  }

  .hero-video-container video {
    border-radius: 0 0 12px 12px;
  }

  .hero-bar-btn {
    width: 32px;
    height: 32px;
  }

  .hero-bar-icon {
    width: 18px;
    height: 18px;
  }

  .hero-flag-dropdown {
    width: 220px;
    max-height: 300px;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .lesson-card {
    padding: 1rem;
    gap: 1rem;
  }

  .lesson-card-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .lesson-card-title {
    font-size: 1rem;
  }

  .target-lang-item {
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
  }
}

/* Tablet / mobile */
@media (max-width: 768px) {
  .flag-grid {
    display: grid;
  }

  body {
    background-attachment: scroll;
  }
}

/* Desktop */
@media (min-width: 769px) {
  .flag-grid {
    display: none !important;
  }
}

@media (min-width: 1200px) {
  .lessons-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   Learn (Language Combo) Page
   ========================================================================== */

.learn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.learn-brand {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: #FFFFFF;
}

.learn-brand:hover {
  color: #FFFFFF;
}

.learn-back {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

.learn-back:hover {
  color: #FFFFFF;
}

/* ---------- Language Pair Selector ---------- */

.learn-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
  flex-wrap: wrap;
}

.learn-selector-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.learn-selector-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.learn-select {
  background: rgba(30, 58, 95, 0.5);
  border: 1px solid rgba(65, 105, 225, 0.3);
  border-radius: 8px;
  padding: 0.625rem 1rem;
  color: #FFFFFF;
  font-size: 1rem;
  font-family: 'Source Sans 3', sans-serif;
  cursor: pointer;
  min-width: 160px;
}

.learn-select option {
  background: #1E3A5F;
  color: #FFFFFF;
}

.learn-selector-arrow {
  font-size: 1.5rem;
  color: #FFD700;
  margin-top: 1.25rem;
}

/* ---------- Content ---------- */

.learn-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.learn-loading {
  text-align: center;
  padding: 4rem;
  color: rgba(255, 255, 255, 0.5);
}

.learn-hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.learn-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.learn-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
}

/* ---------- Difficulty Meter ---------- */

.difficulty-meter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.difficulty-bars {
  display: flex;
  gap: 4px;
}

.difficulty-bar {
  width: 32px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s;
}

.difficulty-bar.filled {
  background: #FFD700;
}

.difficulty-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #FFD700;
}

/* ---------- Learn Sections ---------- */

.learn-section {
  margin-bottom: 3rem;
}

.learn-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.learn-section-desc {
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ---------- Challenge Cards ---------- */

.challenges-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.challenge-card {
  background: rgba(30, 58, 95, 0.3);
  border: 1px solid rgba(65, 105, 225, 0.15);
  border-radius: 16px;
  padding: 1.5rem;
}

.challenge-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #FFFFFF;
}

.challenge-desc {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.challenge-diagrams {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- Diagram Cards ---------- */

.diagram-card {
  background: rgba(15, 31, 51, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  width: 160px;
}

.diagram-card:hover,
.diagram-card:focus-visible {
  border-color: rgba(255, 215, 0, 0.5);
  transform: translateY(-2px);
}

.diagram-card-multi {
  width: auto;
  max-width: 100%;
  cursor: default;
}

.diagram-card-multi:hover {
  transform: none;
}

.diagram-panels {
  display: flex;
  gap: 0.5rem;
}

.diagram-overlay-panel {
  text-align: center;
  width: 120px;
}

.diagram-overlay-label {
  font-size: 0.75rem;
  color: #FFD700;
  font-weight: 600;
  margin-top: 0.25rem;
  display: block;
}

.diagram-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  aspect-ratio: 1;
  object-fit: cover;
}

.diagram-name {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.5rem;
  text-transform: capitalize;
}

/* ---------- Lesson Recommendations ---------- */

.lesson-recs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lesson-rec-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 58, 95, 0.3);
  border: 1px solid rgba(65, 105, 225, 0.15);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  color: #FFFFFF;
  transition: border-color 0.2s;
}

.lesson-rec-card:hover {
  border-color: rgba(65, 105, 225, 0.4);
  color: #FFFFFF;
}

.lesson-rec-title {
  font-weight: 600;
}

.lesson-rec-duration {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
}

/* ---------- Tips ---------- */

.tips-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tip-item {
  background: rgba(30, 58, 95, 0.3);
  border: 1px solid rgba(255, 215, 0, 0.1);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9375rem;
  line-height: 1.6;
  position: relative;
  padding-left: 2.5rem;
}

.tip-item::before {
  content: '\2713';
  position: absolute;
  left: 1rem;
  color: #FFD700;
  font-weight: 700;
}

/* ---------- Learn CTA ---------- */

.learn-cta-section {
  text-align: center;
  padding: 3rem 0;
}

.learn-cta-btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: #4169E1;
  border-radius: 10px;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  transition: background 0.2s, transform 0.15s;
  margin-top: 1rem;
}

.learn-cta-btn:hover {
  background: #5A7FE8;
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* ---------- Not Found ---------- */

.learn-not-found {
  text-align: center;
  padding: 4rem 2rem;
}

.learn-not-found h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.learn-not-found p {
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 2rem;
}

.learn-available-combos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.combo-link {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  background: rgba(30, 58, 95, 0.3);
  border: 1px solid rgba(65, 105, 225, 0.2);
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 0.9375rem;
  transition: border-color 0.2s;
}

.combo-link:hover {
  border-color: #4169E1;
  color: #FFFFFF;
}

/* ---------- Learn Responsive ---------- */

@media (max-width: 480px) {
  .learn-title {
    font-size: 1.75rem;
  }

  .learn-selector {
    flex-direction: column;
    gap: 0.75rem;
  }

  .learn-selector-arrow {
    transform: rotate(90deg);
    margin-top: 0;
  }

  .diagram-card {
    width: 120px;
  }

  .diagram-overlay-panel {
    width: 90px;
  }
}
