/* ============================================
   Past Tense Study App — Tema Past Simple & Continuous ⏰
   WasWere=#3498db  PastSimple=#e74c3c
   SpellingRules=#f39c12  IrregularVerbs=#8e44ad
   TimeExpressions=#27ae60  PastContinuous=#e67e22
   ============================================ */

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

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

/* ---- 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: #2c3e50;
  margin-bottom: 8px;
}
h2 {
  font-size: 1.6rem;
  text-align: center;
  color: #2c3e50;
  margin-bottom: 16px;
}
h3 {
  font-size: 1.25rem;
  margin: 20px 0 8px;
  padding-bottom: 4px;
}
h4 {
  font-size: 1.05rem;
  color: #555;
  margin: 12px 0 6px;
}
.subtitle {
  text-align: center;
  font-size: 1.15rem;
  color: #555;
  margin-bottom: 24px;
}

/* ---- Color Classes (inline text) ---- */
.color-was-were       { color: #3498db; font-weight: 600; }
.color-past-simple    { color: #e74c3c; font-weight: 600; }
.color-spelling       { color: #f39c12; font-weight: 600; }
.color-irregular      { color: #8e44ad; font-weight: 600; }
.color-time-expr      { color: #27ae60; font-weight: 600; }
.color-past-cont      { color: #e67e22; font-weight: 600; }

/* ---- Menu Grid (main screen) ---- */
.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;
  padding: 24px 16px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  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 #2c3e50;
}
.menu-btn--guide {
  background: linear-gradient(135deg, #3498db, #5dade2);
}
.menu-btn--tests {
  background: linear-gradient(135deg, #e74c3c, #ec7063);
}
.menu-emoji { font-size: 2.5rem; }
.menu-title { font-size: 1.2rem; font-weight: 700; }

/* ---- Test Menu Grid ---- */
.test-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.test-menu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.test-menu-btn:hover,
.test-menu-btn:focus {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  outline: 3px solid #2c3e50;
}
.test-menu-btn .menu-emoji { font-size: 2rem; }
.test-menu-btn--conjugation    { background: linear-gradient(135deg, #e74c3c, #ec7063); }
.test-menu-btn--highlighting   { background: linear-gradient(135deg, #8e44ad, #a569bd); }
.test-menu-btn--regular-irreg  { background: linear-gradient(135deg, #f39c12, #f5b041); }
.test-menu-btn--was-were       { background: linear-gradient(135deg, #3498db, #5dade2); }
.test-menu-btn--tense-choice   { background: linear-gradient(135deg, #27ae60, #52be80); }
.test-menu-btn--fill-blank     { background: linear-gradient(135deg, #e67e22, #eb984e); }
.test-menu-btn--error-correct  { background: linear-gradient(135deg, #2c3e50, #566573); }

/* ---- Back Button ---- */
.btn-back {
  display: inline-block;
  padding: 8px 16px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid #3498db;
  border-radius: 10px;
  background: transparent;
  color: #3498db;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.15s, color 0.15s;
}
.btn-back:hover,
.btn-back:focus {
  background: #3498db;
  color: #fff;
  outline: none;
}

/* ---- Guide Content ---- */
.guide-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* ---- Guide Sections (color-coded for 6 topics) ---- */
.guide-section {
  margin-bottom: 28px;
  border-radius: 12px;
  padding: 18px;
}
.guide-section--was-were {
  background: #eaf4fc;
  border-left: 5px solid #3498db;
}
.guide-section--was-were h3 { color: #3498db; border-bottom: 2px solid #3498db; }

.guide-section--past-simple {
  background: #fdedec;
  border-left: 5px solid #e74c3c;
}
.guide-section--past-simple h3 { color: #e74c3c; border-bottom: 2px solid #e74c3c; }

.guide-section--spelling {
  background: #fef9e7;
  border-left: 5px solid #f39c12;
}
.guide-section--spelling h3 { color: #f39c12; border-bottom: 2px solid #f39c12; }

.guide-section--irregular {
  background: #f4ecf7;
  border-left: 5px solid #8e44ad;
}
.guide-section--irregular h3 { color: #8e44ad; border-bottom: 2px solid #8e44ad; }

.guide-section--time-expressions {
  background: #eafaf1;
  border-left: 5px solid #27ae60;
}
.guide-section--time-expressions h3 { color: #27ae60; border-bottom: 2px solid #27ae60; }

.guide-section--past-continuous {
  background: #fdf2e9;
  border-left: 5px solid #e67e22;
}
.guide-section--past-continuous h3 { color: #e67e22; border-bottom: 2px solid #e67e22; }

/* ---- Guide Box (explanations) ---- */
.guide-box {
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 10px 0 16px;
  font-size: 1.05rem;
}
.guide-box p { margin-bottom: 6px; }
.guide-box p:last-child { margin-bottom: 0; }
.guide-box ul {
  margin: 6px 0 6px 20px;
}
.guide-box li {
  margin-bottom: 4px;
}

/* ---- Example Box ---- */
.example-box {
  background: rgba(255,255,255,0.8);
  border: 1px dashed #bbb;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 10px 0;
  font-size: 1.05rem;
}
.example-box p { margin-bottom: 6px; }
.example-box p:last-child { margin-bottom: 0; }

/* ---- Pronoun / Verb Tables ---- */
.pronoun-table,
.verb-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 1.05rem;
}
.pronoun-table th,
.verb-table th {
  background: #3498db;
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}
.pronoun-table td,
.verb-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #ddd;
}
.pronoun-table tr:nth-child(even) td,
.verb-table tr:nth-child(even) td {
  background: #f0f8ff;
}
.verb-table th {
  background: #8e44ad;
}
.verb-table tr:nth-child(even) td {
  background: #f9f0fc;
}

/* ---- Score Display ---- */
.score-display {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: #3498db;
  background: #eaf4fc;
  border-radius: 10px;
  padding: 8px 16px;
  margin-bottom: 16px;
}

/* ---- Exercise Area ---- */
.exercise-area {
  background: #fff;
  border-radius: 16px;
  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: #777;
  margin-bottom: 6px;
}
.sentence-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2c3e50;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 14px 18px;
  border: 2px dashed #bbb;
}

/* ---- Completion Message ---- */
.completion-message {
  text-align: center;
  font-size: 1.3rem;
  padding: 24px;
  color: #27ae60;
}

/* ---- Analysis / Exercise Form ---- */
.analysis-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-group label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #444;
}
.form-input,
.form-select {
  padding: 10px 14px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid #ccc;
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
}

/* ---- Correct / Incorrect field states ---- */
.field-correct {
  border-color: #27ae60 !important;
  background: #eafaf1 !important;
}
.field-incorrect {
  border-color: #e74c3c !important;
  background: #fdedec !important;
}
.expected-hint {
  font-size: 0.85rem;
  color: #c0392b;
  margin-top: 2px;
  font-style: italic;
}

/* ---- Feedback ---- */
.feedback {
  min-height: 24px;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  border-radius: 10px;
  padding: 8px;
}
.feedback-correct {
  color: #27ae60;
  background: #eafaf1;
}
.feedback-incorrect {
  color: #c0392b;
  background: #fdedec;
}

/* ---- 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: 10px;
  background: #3498db;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover,
.btn-primary:focus {
  background: #2980b9;
  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: 10px;
  background: #27ae60;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-next:hover,
.btn-next:focus {
  background: #1e8449;
  outline: none;
}
.btn-next:active {
  transform: scale(0.97);
}

.hidden {
  display: none !important;
}

/* ---- Text Highlighting Test ---- */
.highlight-text-area {
  font-size: 1.2rem;
  line-height: 2;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  border: 2px dashed #bbb;
}
.highlight-word {
  display: inline-block;
  padding: 2px 6px;
  margin: 2px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}
.highlight-word:hover {
  border-color: #aaa;
}
.highlight-word--none {
  background: transparent;
}
.highlight-word--past-simple-regular {
  background: rgba(231,76,60,0.25);
  border-color: #e74c3c;
}
.highlight-word--past-simple-irregular {
  background: rgba(142,68,173,0.25);
  border-color: #8e44ad;
}
.highlight-word--past-continuous {
  background: rgba(230,126,34,0.25);
  border-color: #e67e22;
}

.highlight-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.highlight-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.highlight-legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-block;
}
.swatch--regular   { background: rgba(231,76,60,0.35); border: 2px solid #e74c3c; }
.swatch--irregular { background: rgba(142,68,173,0.35); border: 2px solid #8e44ad; }
.swatch--continuous { background: rgba(230,126,34,0.35); border: 2px solid #e67e22; }

/* ---- Regular/Irregular & Was/Were & Tense Choice list styles ---- */
.exercise-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.exercise-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: #f8f9fa;
  flex-wrap: wrap;
}
.exercise-row:nth-child(even) {
  background: #f0f4f8;
}
.exercise-row .verb-label {
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 120px;
  color: #2c3e50;
}
.exercise-row .sentence-label {
  flex: 1;
  font-size: 1.05rem;
  color: #2c3e50;
  margin-bottom: 0;
}
.exercise-row .radio-group {
  display: flex;
  gap: 14px;
}
.exercise-row .radio-group label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 1rem;
}
.exercise-row .radio-group input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.exercise-row .form-select {
  min-width: 140px;
}
.row-correct {
  background: #eafaf1 !important;
  border-left: 4px solid #27ae60;
}
.row-incorrect {
  background: #fdedec !important;
  border-left: 4px solid #e74c3c;
}

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

@media (max-width: 600px) {
  body {
    padding: 10px;
    font-size: 16px;
  }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.1rem; }

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

  .test-menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .test-menu-btn {
    padding: 14px 8px;
    font-size: 0.85rem;
  }
  .test-menu-btn .menu-emoji { font-size: 1.6rem; }

  .guide-content {
    padding: 14px;
  }
  .guide-section {
    padding: 12px;
  }

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

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

  .pronoun-table,
  .verb-table {
    font-size: 0.95rem;
  }
  .pronoun-table th,
  .pronoun-table td,
  .verb-table th,
  .verb-table td {
    padding: 6px 10px;
  }

  .exercise-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .exercise-row .verb-label {
    min-width: auto;
  }

  .highlight-legend {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .highlight-text-area {
    font-size: 1.05rem;
    padding: 12px;
  }
}

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