/**
 * UtterOn - Minimal, mobile-first CSS
 * Single column, large text, minimal buttons
 */

/* ============================================
   Base & Variables
   ============================================ */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --accent: #4361ee;
  --accent-hover: #3651de;
  --success: #2ecc71;
  --danger: #e74c3c;
  --border: #e0e0e0;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --spacing: 1.5rem;
}

:root[data-theme="dark"] {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0c0;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --border: #2a2a4a;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Layout
   ============================================ */

.utteron-container {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--spacing);
}

.utteron-container h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.utteron-container h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.native-name {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.logo-text {
  font-weight: 800;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

/* ============================================
   Hero Section
   ============================================ */

.hero-section {
  text-align: center;
  padding: 5rem 1rem 4rem;
  margin-bottom: 3rem;
  /* Removed boxy background/border */
  animation: fade-in-up 0.8s ease-out;
}

.hero-section h1 {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.4rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 400;
}

@media (max-width: 600px) {
  .hero-section {
    padding: 3rem 1rem;
    margin-bottom: 2rem;
  }

  .hero-section h1 {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }
}

/* ============================================
   Content Pages (About / Support)
   ============================================ */

.page-header {
  text-align: center;
  padding: 3rem 1rem 2rem;
  margin-bottom: 2rem;
  animation: fade-in-up 0.8s ease-out;
}

.page-header h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.content-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-bottom: 2rem;
  animation: fade-in-up 0.8s ease-out 0.2s backwards;
}

.content-card h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.content-card p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.faq-item {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.faq-item h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.faq-item p {
  margin-bottom: 0;
}

/* ============================================
   Language Cards
   ============================================ */

.language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.language-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  text-decoration: none;
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
  animation: fade-in-up 0.8s ease-out 0.2s backwards;
}

.language-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  border-color: var(--accent);
}

.card-flag {
  font-size: 4rem;
  background-image: url('/images/cesky-krumlov-2-1815874_960_720.jpg');
  background-size: cover;
  background-position: center;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  position: relative;
  min-height: 180px;
  /* Ensure flag emoji appears above overlay */
  isolation: isolate;
}

.card-flag::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(67, 97, 238, 0.3) 100%);
  z-index: -1;
}

:root[data-theme="dark"] .card-flag::before {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.7) 0%, rgba(67, 97, 238, 0.5) 100%);
}

.language-card:hover .card-flag {
  transform: scale(1.05);
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-primary);
  flex: 1;
}

.language-card h2 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--text-primary);
  font-weight: 700;
}

.language-card .native-name {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.card-action {
  margin-top: auto;
  padding-top: 1rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.language-card:hover .card-action {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================
   Features Section
   ============================================ */

.features-section {
  margin-top: 6rem;
  text-align: center;
  animation: fade-in-up 0.8s ease-out 0.4s backwards;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  padding: 2rem;
  background: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--border);
  box-shadow: var(--card-shadow);
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  display: inline-block;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ============================================
   Animations
   ============================================ */

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Group Cards
   ============================================ */

.group-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.group-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  gap: 1rem;
  position: relative;
}

/* Header with title and level badge */
.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.group-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--text-primary);
  padding-right: 5rem;
}

.level-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}

/* Metadata grid */
.group-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meta-row {
  display: flex;
  gap: 1.5rem;
}

.meta-item {
  display: flex;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.meta-item.full-width {
  flex: 1;
}

.meta-label {
  color: var(--text-secondary);
}

.meta-value {
  color: var(--text-primary);
  font-weight: 500;
}

.meta-value.done {
  color: var(--success);
}

.meta-value.not-done {
  color: var(--text-secondary);
}

/* Start button */
.start-btn {
  display: block;
  text-align: center;
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: background 0.2s;
  margin-top: 1rem;
  /* Add spacing from metadata */
}

.start-btn:hover {
  background: var(--accent-hover);
}

/* Green highlighting for 100% scores and today practice */
.perfect-score,
.practiced-today,
.has-streak {
  color: #4ade80 !important;
  font-weight: 600;
}

/* Legacy support */
.group-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.completion-badge {
  font-size: 1.5rem;
  color: var(--text-secondary);
}

.completion-badge.complete {
  color: var(--success);
}

/* ============================================
   Training Interface
   ============================================ */

.train-container {
  min-height: 80vh;
}

.train-header {
  margin-bottom: 1.5rem;
}

.group-subtitle {
  margin: 0.25rem 0 0 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-style: italic;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* Exercise Card */
.exercise-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

/* Exercise Type Badge */
.exercise-type {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
}

.exercise-type.listen {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}

.exercise-type.read {
  background: rgba(46, 204, 113, 0.15);
  color: var(--success);
}

/* Prompt Area */
.prompt-area {
  min-height: 80px;
  margin-bottom: 1.5rem;
}

.prompt-area .instruction {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0.5rem 0 0 0;
}

/* Text Styles */
.native-text {
  font-size: 1.8rem;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}

.native-text.large {
  font-size: 2.2rem;
}

.english-text {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin: 0.5rem 0 0 0;
}

.gender-hint {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: rgba(156, 163, 175, 0.2);
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Audio Container */
.audio-container {
  width: 100%;
  margin-bottom: 1.5rem;
  text-align: center;
}

.audio-container audio {
  display: none;
}

.replay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.replay-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.replay-btn svg {
  flex-shrink: 0;
}

/* Reveal Area */
.reveal-area {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Action Area - Fixed position, centered */
.action-area {
  min-height: 60px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Report Buttons */
.report-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.report-btn {
  flex: 1;
  max-width: 150px;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.report-btn.got-it {
  background: var(--success);
  color: white;
}

.report-btn.got-it:hover {
  background: #27ae60;
}

.report-btn.missed {
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.report-btn.missed:hover {
  background: var(--border);
}

/* Action Button Styles */
.action-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.action-btn:hover {
  background: var(--accent-hover);
}

.action-btn.primary {
  min-width: 160px;
}

.action-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.action-btn.secondary:hover {
  background: var(--border);
}

/* Progress Indicator */
.progress-indicator {
  margin-top: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Completion Message */
.completion-message {
  text-align: center;
  padding: 3rem 1rem;
}

.completion-message h2 {
  font-size: 2rem;
  color: var(--success);
  margin-bottom: 1rem;
}

.completion-actions {
  margin-top: 2rem;
}

/* No Group */
.no-group {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.no-group p {
  margin-bottom: 1.5rem;
}

/* ============================================
   Header Buttons
   ============================================ */

.btn-header {
  display: inline-block;
  background: transparent;
  /* Subtle: no background by default */
  color: var(--text-secondary) !important;
  /* Subtle: secondary text color */
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  /* Subtle: no border by default */
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  margin-left: 0.5rem;
}

.btn-header:hover {
  background: var(--bg-secondary);
  color: var(--text-primary) !important;
  border-color: var(--border);
  transform: translateY(-1px);
}

.btn-header span {
  border-bottom: none !important;
  /* Remove theme underline */
}

/* Active state for header buttons */
.btn-header .active {
  border-bottom: none !important;
}

/* ============================================
   Card Layout Updates
   ============================================ */

.group-content-wrapper {
  display: flex;
  gap: 1.5rem;
}

.group-info-col {
  flex: 1;
  min-width: 250px;
}

.group-desc-col {
  flex: 1;
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
  display: flex;
  align-items: flex-start;
  padding-top: 0.5rem;
}

.group-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-line;

  /* THE INDENT TRICK */
  padding-left: 1.25rem;
  /* 1. Pushes ALL text to the right (the "tab") */
  text-indent: -1.25rem;
  /* 2. Pulls ONLY the first line back to the left */
}

.group-description::first-line {
  /* DIALED BACK STYLES */
  font-weight: 600;
  /* Semi-bold instead of heavy bold */
  font-size: 1.0rem;
  /* Kept same size as body text (or tiny bit larger) */
  color: var(--text-primary);

  /* Adds space between the header and the indented list */
  line-height: 2.2;
}

.group-description.placeholder {
  font-style: italic;
  opacity: 0.7;
}

/* Mobile: Stack layout and show description */
@media (max-width: 600px) {
  .group-content-wrapper {
    flex-direction: column;
  }

  .group-info-col {
    min-width: auto;
  }

  .group-desc-col {
    display: block;
    border-left: none;
    padding-left: 0;
    padding-top: 1rem;
  }
}

/* ============================================
   Heading Card (Stats Redesign)
   ============================================ */

.language-header-card {
  background-image: url('/images/cesky-krumlov-2-1815874_960_720.jpg');
  background-size: cover;
  background-position: center;
  border: none;
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem 3rem;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.language-header-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(67, 97, 238, 0.35) 100%);
  border-radius: var(--radius);
  z-index: -1;
}

:root[data-theme="dark"] .language-header-card::before {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.85) 0%, rgba(67, 97, 238, 0.7) 100%);
}

.lang-title-section {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lang-title-section h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
}

.native-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.native-name-large {
  font-size: 1rem;
  color: var(--text-secondary);
}

.audio-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
  font-size: 1rem;
}

.audio-btn:hover {
  opacity: 1;
}

.lang-stats-grid {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 65px;
}

.stat-label-sm {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.stat-value-sm {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.stat-value-sm.target-met {
  color: var(--success);
}

.stat-value-wrapper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 70px;
  justify-content: center;
}

.stat-arrow {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.5rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  opacity: 0.4;
  transition: opacity 0.2s, color 0.2s;
}

.stat-arrow:hover {
  opacity: 1;
  color: var(--accent);
}

.stat-arrow.up::before {
  content: '◀';
}

.stat-arrow.down::before {
  content: '▶';
}

@media (max-width: 900px) {
  .language-header-card {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .lang-stats-grid {
    width: 100%;
    justify-content: center;
    gap: 1rem;
  }

  .stat-col {
    min-width: auto;
  }

  .stat-label-sm {
    font-size: 0.65rem;
  }

  .stat-value-sm {
    font-size: 1.1rem;
  }
}

/* ============================================
   Fundamentals Buttons
   ============================================ */

.fundamentals-section {
  width: 100%;
  flex-basis: 100%;
  margin-top: 1.5rem;
  padding-top: 0;
  border-top: none;
  text-align: center;
}

.fundamentals-caption {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  text-align: left;
}

.fundamentals-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
}

.fundamental-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  min-width: 70px;
  transition: all 0.2s;
}

.fundamental-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.fundamental-btn:hover .fundamental-label,
.fundamental-btn:hover .fundamental-score {
  color: white;
}

.fundamental-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.fundamental-score {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* Green highlight for 100% completion today */
.fundamental-btn.complete-today {
  background: rgba(46, 204, 113, 0.15);
  border-color: var(--success);
}

.fundamental-btn.complete-today .fundamental-label,
.fundamental-btn.complete-today .fundamental-score {
  color: var(--success);
}

@media (max-width: 480px) {
  .fundamentals-row {
    gap: 0.4rem;
  }

  .fundamental-btn {
    min-width: 55px;
    padding: 0.4rem 0.5rem;
  }

  .fundamental-label {
    font-size: 0.65rem;
  }

  .fundamental-score {
    font-size: 0.6rem;
  }
}

/* Language Flag Display */
.lang-flag-display {
  font-size: 3rem;
  line-height: 1;
  margin-top: 0.25rem;
}

.reset-note {
  font-size: 0.8em;
  opacity: 0.7;
  font-weight: 400;
}