/* ==========================================================================
   SportsLingo Core CSS Design System
   Field Green Palette, Absolutely Fixed Bottom Bars, Precision Viewport Layout
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Color Tokens */
  --bg-pitch-dark: #0B1D16;
  --bg-card-glass: rgba(18, 48, 37, 0.85);
  --bg-card-border: rgba(0, 255, 135, 0.25);
  --primary-green: #1B4D3E;
  --primary-light: #2A6F5A;
  --accent-neon: #00FF87;
  --accent-neon-glow: rgba(0, 255, 135, 0.35);
  --gold-accent: #FFB800;
  --text-main: #FFFFFF;
  --text-muted: #A0C4B6;
  --text-dim: #648D7C;

  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.35);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-pitch-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow: hidden;
  font-size: 16px;
}

/* Background Pitch Gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 255, 135, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(27, 77, 62, 0.4) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Main Container Layout */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgba(11, 29, 22, 0.95);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
  border-left: 1px solid rgba(0, 255, 135, 0.1);
  border-right: 1px solid rgba(0, 255, 135, 0.1);
  overflow: hidden;
}

/* App Header Bar */
.app-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 48, 37, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-card-border);
  flex-shrink: 0;
  height: 64px;
  z-index: 120;
}

/* Top Left Back Button */
.header-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.header-back-btn:hover {
  background: rgba(0, 255, 135, 0.15);
  border-color: var(--accent-neon);
  color: var(--accent-neon);
}

/* Top Center Title Badge */
.header-center-title {
  background: rgba(0, 255, 135, 0.1);
  border: 1px solid rgba(0, 255, 135, 0.25);
  color: var(--accent-neon);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Top Right Logo Icon Home Button */
.header-logo-icon-btn {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.header-logo-icon-btn:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 8px var(--accent-neon-glow));
}

/* Screen Layout */
.screen {
  position: relative;
  display: none;
  flex: 1;
  height: calc(100vh - 64px);
  overflow: hidden;
  animation: fadeIn 0.3s ease-out forwards;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 90px 20px;
}

.screen-scroll-body::-webkit-scrollbar {
  width: 4px;
}
.screen-scroll-body::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 135, 0.25);
  border-radius: 4px;
}

/* Absolutely Fixed Bottom Action Bar for Selection Screens */
.screen-fixed-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 14px 20px 24px 20px;
  background: rgba(11, 29, 22, 0.98);
  border-top: 1px solid rgba(0, 255, 135, 0.2);
  z-index: 100;
}

/* ==========================================================================
   Screen 1: Splash / Home Screen
   ========================================================================== */
.splash-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.splash-hero-graphic {
  position: relative;
  margin-bottom: 28px;
}

.hero-glow-ring {
  position: absolute;
  top: -14px;
  left: -14px;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-neon-glow) 0%, transparent 70%);
  animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 0.9; }
}

.hero-logo-svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 8px 24px var(--accent-neon-glow));
}

.splash-title {
  font-family: var(--font-heading);
  font-size: 2.7rem;
  font-weight: 800;
  line-height: 1.15;
  color: #FFFFFF;
  margin-bottom: 8px;
}

.splash-tagline {
  color: var(--accent-neon);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 1px;
}

/* Primary Action Buttons */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-neon), #00C86F);
  color: #051A13;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 6px 20px var(--accent-neon-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition-fast);
}

.btn-primary:hover, .btn-primary:active {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px var(--accent-neon-glow);
  filter: brightness(1.05);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   Screen 2 & 3: Language & Sport Selection Cards
   ========================================================================== */
.section-header {
  margin-bottom: 20px;
}

.step-indicator {
  color: var(--accent-neon);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.selection-card {
  background: var(--bg-card-glass);
  border: 1.5px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.selection-card:hover, .selection-card.selected {
  background: rgba(27, 77, 62, 0.95);
  border-color: var(--accent-neon);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 255, 135, 0.2);
}

.card-flag-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
}

.card-native {
  color: var(--accent-neon);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 2px;
}

/* ==========================================================================
   Screen 4: Phrases & Practice Module Layout
   ========================================================================== */

/* Top Section: Category Tabs & View Switcher */
.practice-header-section {
  flex-shrink: 0;
  padding-top: 16px;
}

.category-tabs-wrapper {
  overflow-x: auto;
  padding: 0 20px 12px 20px;
  -webkit-overflow-scrolling: touch;
}

.category-tabs-wrapper::-webkit-scrollbar {
  height: 4px;
}
.category-tabs-wrapper::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 135, 0.3);
  border-radius: 4px;
}

.category-tabs-bar {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.cat-tab {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.cat-tab.active {
  background: var(--primary-green);
  border-color: var(--accent-neon);
  color: var(--accent-neon);
  box-shadow: 0 4px 12px rgba(0, 255, 135, 0.18);
}

.cat-count-badge {
  background: rgba(0, 255, 135, 0.15);
  color: var(--accent-neon);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.75rem;
}

/* View Mode Bar: Practice vs View All */
.view-mode-bar {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin: 0 20px 12px 20px;
  gap: 4px;
}

.view-mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-fast);
}

.view-mode-btn.active {
  background: rgba(0, 255, 135, 0.15);
  color: var(--accent-neon);
  border: 1px solid rgba(0, 255, 135, 0.35);
}

/* Practice Body Section */
.practice-body-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 80px; /* Space for fixed bottom bar */
}

/* Single Card Stage */
.single-card-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 20px;
  overflow-y: auto;
}

/* Phrase Card */
.phrase-card {
  width: 100%;
  background: var(--bg-card-glass);
  border: 2px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.phrase-target-text {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.25;
  color: #FFFFFF;
  margin-bottom: 14px;
}

.phrase-english {
  color: var(--accent-neon);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.phrase-cue-box {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Audio Control */
.audio-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.listen-play-btn {
  background: linear-gradient(135deg, var(--primary-green), #133A2E);
  border: 2px solid var(--accent-neon);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 15px 36px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 22px rgba(0, 255, 135, 0.28);
  transition: var(--transition-fast);
}

.listen-play-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 28px var(--accent-neon-glow);
}

/* Absolutely Fixed Bottom Navigation Bar for Practice Screen */
.practice-fixed-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 14px 20px 24px 20px;
  background: rgba(11, 29, 22, 0.98);
  border-top: 1px solid rgba(0, 255, 135, 0.2);
  z-index: 100;
}

.phrase-nav-bar {
  display: flex;
  gap: 12px;
}

.btn-secondary {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  padding: 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
}

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

/* ==========================================================================
   Scrollable View All Phrases List Stage
   ========================================================================== */
.all-phrases-stage {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 20px 10px 20px;
}

.all-phrases-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.all-phrases-list::-webkit-scrollbar {
  width: 4px;
}
.all-phrases-list::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 135, 0.3);
  border-radius: 4px;
}

.phrase-row-card {
  background: var(--bg-card-glass);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: var(--transition-fast);
}

.phrase-row-card:hover {
  border-color: var(--accent-neon);
  background: rgba(27, 77, 62, 0.85);
}

.phrase-row-info {
  flex: 1;
}

.phrase-row-target {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: #FFFFFF;
}

.phrase-row-english {
  color: var(--accent-neon);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 3px;
}

.phrase-row-play-btn {
  background: rgba(0, 255, 135, 0.12);
  border: 1px solid rgba(0, 255, 135, 0.4);
  color: var(--accent-neon);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.phrase-row-play-btn:hover {
  transform: scale(1.08);
  background: var(--accent-neon);
  color: #051A13;
}
