/* ============================================
   Sentence Analysis Study App — Tema Gramática 📝
   Subject=#3498db  Auxiliary=#f39c12
   Verb=#e74c3c     Complement=#27ae60
   ============================================ */

* {
  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-subject    { color: #3498db; font-weight: 600; }
.color-auxiliary   { color: #f39c12; font-weight: 600; }
.color-verb        { color: #e74c3c; font-weight: 600; }
.color-complement  { color: #27ae60; 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--practice {
  background: linear-gradient(135deg, #e74c3c, #ec7063);
}
.menu-emoji { font-size: 2.5rem; }
.menu-title { font-size: 1.2rem; font-weight: 700; }

/* ---- 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) ---- */
.guide-section {
  margin-bottom: 28px;
  border-radius: 12px;
  padding: 18px;
}
.guide-section--subject {
  background: #eaf4fc;
  border-left: 5px solid #3498db;
}
.guide-section--subject h3 { color: #3498db; border-bottom: 2px solid #3498db; }

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

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

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

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

/* ---- 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 (inline examples) ---- */
.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 Table ---- */
.pronoun-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 1.05rem;
}
.pronoun-table th {
  background: #3498db;
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}
.pronoun-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #ddd;
}
.pronoun-table tr:nth-child(even) td {
  background: #f0f8ff;
}

/* ---- Full Example Cards ---- */
.example-full {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.example-sentence {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.6;
}
.example-sentence span {
  padding: 2px 4px;
  border-radius: 4px;
}
.example-sentence .color-subject    { background: rgba(52,152,219,0.12); }
.example-sentence .color-auxiliary   { background: rgba(243,156,18,0.12); }
.example-sentence .color-verb        { background: rgba(231,76,60,0.12); }
.example-sentence .color-complement  { background: rgba(39,174,96,0.12); }

.example-details {
  list-style: none;
  padding: 0;
  font-size: 0.95rem;
  color: #555;
}
.example-details li {
  margin-bottom: 3px;
}

/* ---- 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 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;
  box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
}

/* Color-coded form field borders */
.input--subject,
.form-group--subject .form-input {
  border-color: #3498db;
}
.input--subject:focus,
.form-group--subject .form-input:focus {
  border-color: #2980b9;
  box-shadow: 0 0 0 3px rgba(52,152,219,0.2);
}

.input--auxiliary,
.form-group--auxiliary .form-input {
  border-color: #f39c12;
}
.input--auxiliary:focus,
.form-group--auxiliary .form-input:focus {
  border-color: #e67e22;
  box-shadow: 0 0 0 3px rgba(243,156,18,0.2);
}

.input--verb,
.form-group--verb .form-input {
  border-color: #e74c3c;
}
.input--verb:focus,
.form-group--verb .form-input:focus {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(231,76,60,0.2);
}

.input--complement,
.form-group--complement .form-input {
  border-color: #27ae60;
}
.input--complement:focus,
.form-group--complement .form-input:focus {
  border-color: #1e8449;
  box-shadow: 0 0 0 3px rgba(39,174,96,0.2);
}

/* Correct / Incorrect field states */
.field-correct {
  border-color: #27ae60 !important;
  background: #eafaf1 !important;
}
.field-incorrect {
  border-color: #e74c3c !important;
  background: #fdedec !important;
}

/* Expected answer hint shown below incorrect fields */
.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;
}

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

  .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 {
    font-size: 0.95rem;
  }
  .pronoun-table th,
  .pronoun-table td {
    padding: 6px 10px;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .menu-btn {
    width: 180px;
  }
}
