/**
 * 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;
}

@media (prefers-color-scheme: dark) {
  :root {
    --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;
}

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

.language-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.language-card {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.language-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.language-card h2 {
  margin: 0 0 0.25rem 0;
  color: var(--text-primary);
}

.language-card .native-name {
  margin: 0;
  font-size: 1rem;
}

/* ============================================
   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: 1.5rem;
  right: 1.5rem;
  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;
}

.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;
}

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

.audio-container audio {
  width: 100%;
  max-width: 100%;
}

/* 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: center;
}

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

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

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

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

.language-header-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3rem;
}

.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: 2rem;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.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;
}

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

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

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

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

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

.lang-stats-grid {
  width: 100%;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

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