/* ============================================
   WILL vs GOING TO Study App — Tema Futuro 🔮
   Will=#3b82f6  GoingTo=#10b981
   Correct=#16a34a  Incorrect=#dc2626
   ============================================ */

/* ---- CSS Custom Properties ---- */
:root {
  --will-primary: #3b82f6;
  --will-soft: #dbeafe;
  --will-text: #1e40af;
  --going-primary: #10b981;
  --going-soft: #d1fae5;
  --going-text: #065f46;
  --correct: #16a34a;
  --correct-soft: #dcfce7;
  --incorrect: #dc2626;
  --incorrect-soft: #fee2e2;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --card-radius: 16px;
  --btn-radius: 12px;
}

/* ---- Reset ---- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', 'Arial Rounded MT Bold', Arial, sans-serif;
  background: linear-gradient(135deg, #eff6ff 0%, #fff 50%, #ecfdf5 100%);
  color: var(--text-dark);
  min-height: 100vh;
  padding: 16px;
  font-size: 18px;
  line-height: 1.6;
}

/* ---- Views ---- */
.view {
  display: none;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}
.view.active {
  display: block;
}

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

/* ---- Typography ---- */
h1 {
  font-size: 2.2rem;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 8px;
}
h2 {
  font-size: 1.7rem;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 16px;
}
h3 {
  font-size: 1.3rem;
  margin: 20px 0 8px;
  padding-bottom: 4px;
}
.subtitle {
  text-align: center;
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ---- Theme Modifiers ---- */
.theme-will {
  --theme-primary: var(--will-primary);
  --theme-soft: var(--will-soft);
  --theme-text: var(--will-text);
}
.theme-going-to {
  --theme-primary: var(--going-primary);
  --theme-soft: var(--going-soft);
  --theme-text: var(--going-text);
}

/* ---- Main Menu Grid ---- */
.menu-grid {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.menu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 220px;
  min-height: 44px;
  padding: 24px 24px;
  border: none;
  border-radius: var(--card-radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--card-shadow);
  color: #fff;
}
.menu-btn:hover,
.menu-btn:focus {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  outline: 3px solid var(--text-dark);
}
.menu-btn--guide {
  background: linear-gradient(135deg, var(--will-primary), #60a5fa);
}
.menu-btn--practice {
  background: linear-gradient(135deg, var(--going-primary), #34d399);
}
.menu-emoji { font-size: 2.5rem; }
.menu-title { font-size: 1.2rem; font-weight: 700; }

/* ---- Guide Menu Grid ---- */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.guide-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 20px 24px;
  border: none;
  border-radius: var(--card-radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--card-shadow);
  color: #fff;
}
.guide-btn:hover,
.guide-btn:focus {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  outline: 3px solid var(--text-dark);
}
.guide-btn--will {
  background: linear-gradient(135deg, var(--will-primary), #60a5fa);
}
.guide-btn--going-to {
  background: linear-gradient(135deg, var(--going-primary), #34d399);
}
.guide-btn--tips {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

/* ---- Exercise Menu Grid ---- */
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.exercise-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 24px 24px;
  border: none;
  border-radius: var(--card-radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--card-shadow);
  color: #fff;
}
.exercise-btn:hover,
.exercise-btn:focus {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  outline: 3px solid var(--text-dark);
}
.exercise-btn--fill-in {
  background: linear-gradient(135deg, var(--will-primary), #60a5fa);
}
.exercise-btn--multiple-choice {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.exercise-btn--classify {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}
.exercise-btn--correct-error {
  background: linear-gradient(135deg, #ef4444, #f87171);
}
.exercise-emoji { font-size: 2.5rem; }
.exercise-title { font-size: 1.1rem; font-weight: 700; }

/* ---- Back Button ---- */
.btn-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 24px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--will-primary);
  border-radius: var(--btn-radius);
  background: transparent;
  color: var(--will-primary);
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.15s, color 0.15s;
}
.btn-back:hover,
.btn-back:focus {
  background: var(--will-primary);
  color: #fff;
  outline: none;
}

/* ---- Guide Content ---- */
.guide-content {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.guide-intro {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 12px;
  border-left: 5px solid var(--theme-primary, var(--will-primary));
}
.guide-intro.theme-will {
  background: var(--will-soft);
  border-left-color: var(--will-primary);
}
.guide-intro.theme-going-to {
  background: var(--going-soft);
  border-left-color: var(--going-primary);
}

/* ---- Use-Case Cards ---- */
.use-case-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 18px;
  margin: 16px 0;
  border-left: 5px solid var(--theme-primary, var(--will-primary));
  animation: fadeIn 0.3s ease;
}
.theme-will .use-case-card {
  border-left-color: var(--will-primary);
  background: #f8fafc;
}
.theme-going-to .use-case-card {
  border-left-color: var(--going-primary);
  background: #f8fdfb;
}
.use-case-card h4 {
  font-size: 1.15rem;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.use-case-card .definition {
  font-size: 1.05rem;
  color: #444;
  margin-bottom: 12px;
  line-height: 1.6;
}
.use-case-card .spanish-note {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 10px;
}

/* ---- Example Lists ---- */
.examples-list {
  list-style: none;
  padding: 0;
}
.examples-list li {
  padding: 8px 12px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  font-size: 1.05rem;
  line-height: 1.6;
}
.examples-list li::before {
  content: "📌 ";
}

/* ---- Highlighted Keywords ---- */
.highlight-will {
  color: var(--will-text);
  font-weight: 700;
}
.highlight-going-to {
  color: var(--going-text);
  font-weight: 700;
}

/* ---- Tips Section: Comparison Table ---- */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.comparison-table thead th {
  padding: 14px 18px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: left;
}
.comparison-table thead th:first-child {
  background: var(--will-soft);
  color: var(--will-text);
}
.comparison-table thead th:nth-child(2) {
  background: var(--going-soft);
  color: var(--going-text);
}
.comparison-table thead th:nth-child(3) {
  background: #f1f5f9;
  color: var(--text-dark);
}
.comparison-table tbody td {
  padding: 12px 18px;
  font-size: 1rem;
  border-top: 1px solid #e2e8f0;
  vertical-align: top;
  line-height: 1.6;
}
.comparison-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

/* ---- Signal Word Lists ---- */
.signal-words-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}
.signal-words-list {
  list-style: none;
  padding: 16px;
  border-radius: 12px;
}
.signal-words-list--will {
  background: var(--will-soft);
  border: 2px solid var(--will-primary);
}
.signal-words-list--going-to {
  background: var(--going-soft);
  border: 2px solid var(--going-primary);
}
.signal-words-list h4 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.signal-words-list--will h4 {
  color: var(--will-text);
}
.signal-words-list--going-to h4 {
  color: var(--going-text);
}
.signal-words-list li {
  padding: 6px 0;
  font-size: 1rem;
  line-height: 1.6;
}
.signal-words-list li::before {
  margin-right: 6px;
}
.signal-words-list--will li::before {
  content: "⚡ ";
}
.signal-words-list--going-to li::before {
  content: "🎯 ";
}

/* ---- Mnemonic Tip ---- */
.mnemonic-tip {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  border-left: 5px solid #f59e0b;
  font-size: 1.05rem;
  line-height: 1.6;
}
.mnemonic-tip::before {
  content: "💡 ";
  font-size: 1.2rem;
}

/* ---- Score Display ---- */
.score-display {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--will-primary);
  background: var(--will-soft);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

/* ---- Exercise Area ---- */
.exercise-area {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ---- Sentence Display ---- */
.sentence-display {
  text-align: center;
  margin-bottom: 20px;
}
.sentence-label {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.sentence-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px 18px;
  border: 2px dashed #cbd5e1;
  line-height: 1.6;
}
.sentence-text .blank {
  display: inline-block;
  min-width: 80px;
  border-bottom: 3px solid var(--will-primary);
  color: var(--will-primary);
  font-weight: 700;
}
.sentence-text .incorrect-part {
  color: var(--incorrect);
  font-weight: 700;
  text-decoration: underline wavy var(--incorrect);
  padding: 2px 4px;
  background: var(--incorrect-soft);
  border-radius: 4px;
}

/* ---- Completion Message ---- */
.completion-message {
  text-align: center;
  font-size: 1.3rem;
  padding: 24px;
  color: var(--correct);
}

/* ---- Form Inputs (Fill-in & Correct-error) ---- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.form-group label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #444;
}
.form-input {
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid #cbd5e1;
  border-radius: var(--btn-radius);
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  min-height: 44px;
  line-height: 1.5;
}
.form-input:focus {
  outline: none;
  border-color: var(--will-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Correct / Incorrect field states */
.field-correct {
  border-color: var(--correct) !important;
  background: var(--correct-soft) !important;
}
.field-incorrect {
  border-color: var(--incorrect) !important;
  background: var(--incorrect-soft) !important;
}

/* Expected answer hint */
.expected-hint {
  font-size: 0.9rem;
  color: var(--incorrect);
  margin-top: 4px;
  font-style: italic;
}

/* ---- Option Buttons (Multiple Choice) ---- */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.option-btn {
  padding: 14px 24px;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 600;
  border: 2px solid var(--will-primary);
  border-radius: var(--btn-radius);
  background: #fff;
  color: var(--will-primary);
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, color 0.15s, transform 0.1s, border-color 0.15s;
}
.option-btn:hover,
.option-btn:focus {
  background: var(--will-soft);
  transform: translateY(-2px);
  outline: none;
}
.option-btn:disabled {
  cursor: default;
  transform: none;
}
.option-btn.option-correct {
  border-color: var(--correct) !important;
  background: var(--correct-soft) !important;
  color: var(--correct) !important;
}
.option-btn.option-incorrect {
  border-color: var(--incorrect) !important;
  background: var(--incorrect-soft) !important;
  color: var(--incorrect) !important;
}

/* ---- Classify Exercise ---- */
.classify-list {
  list-style: none;
  padding: 0;
  margin-bottom: 16px;
}
.classify-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  background: #f8fafc;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.classify-item .sentence-text-inline {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.6;
}
.classify-item.item-correct {
  border-color: var(--correct);
  background: var(--correct-soft);
}
.classify-item.item-incorrect {
  border-color: var(--incorrect);
  background: var(--incorrect-soft);
}

/* Classification Buttons */
.classify-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.classify-btn {
  padding: 12px 18px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  border: 2px solid #cbd5e1;
  border-radius: var(--btn-radius);
  background: #fff;
  color: var(--text-dark);
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.classify-btn:hover,
.classify-btn:focus {
  outline: none;
}
.classify-btn--will:hover,
.classify-btn--will:focus,
.classify-btn--will.selected {
  background: var(--will-soft);
  border-color: var(--will-primary);
  color: var(--will-text);
}
.classify-btn--going-to:hover,
.classify-btn--going-to:focus,
.classify-btn--going-to.selected {
  background: var(--going-soft);
  border-color: var(--going-primary);
  color: var(--going-text);
}
.classify-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

/* ---- Feedback ---- */
.feedback {
  min-height: 24px;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  border-radius: 10px;
  padding: 12px;
  line-height: 1.5;
}
.feedback-correct {
  color: var(--correct);
  background: var(--correct-soft);
}
.feedback-incorrect {
  color: var(--incorrect);
  background: var(--incorrect-soft);
}

/* ---- Buttons ---- */
.btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-primary {
  padding: 12px 28px;
  font-size: 1.15rem;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--btn-radius);
  background: var(--will-primary);
  color: #fff;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover,
.btn-primary:focus {
  background: #2563eb;
  outline: none;
}
.btn-primary:active {
  transform: scale(0.97);
}
.btn-next {
  padding: 12px 28px;
  font-size: 1.15rem;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--btn-radius);
  background: var(--going-primary);
  color: #fff;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, transform 0.1s;
}
.btn-next:hover,
.btn-next:focus {
  background: #059669;
  outline: none;
}
.btn-next:active {
  transform: scale(0.97);
}
.btn-restart {
  padding: 12px 28px;
  font-size: 1.15rem;
  font-family: inherit;
  font-weight: 600;
  border: 2px solid var(--will-primary);
  border-radius: var(--btn-radius);
  background: transparent;
  color: var(--will-primary);
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, color 0.15s;
}
.btn-restart:hover,
.btn-restart:focus {
  background: var(--will-primary);
  color: #fff;
  outline: none;
}

.hidden {
  display: none !important;
}

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

@media (max-width: 600px) {
  body {
    padding: 10px;
    font-size: 16px;
  }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.15rem; }

  .menu-grid {
    flex-direction: column;
    align-items: center;
  }
  .menu-btn {
    width: 100%;
    max-width: 300px;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .exercise-grid {
    grid-template-columns: 1fr;
  }

  .guide-content {
    padding: 14px;
  }

  .use-case-card {
    padding: 14px;
  }

  .exercise-area {
    padding: 16px;
  }
  .sentence-text {
    font-size: 1.15rem;
    padding: 10px 14px;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .signal-words-container {
    grid-template-columns: 1fr;
  }

  .comparison-table {
    font-size: 0.9rem;
  }
  .comparison-table thead th,
  .comparison-table tbody td {
    padding: 10px 12px;
  }

  .classify-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .classify-buttons {
    justify-content: center;
  }

  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-primary,
  .btn-next,
  .btn-restart {
    width: 100%;
    text-align: center;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .menu-btn {
    width: 180px;
  }
  .exercise-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .guide-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
