/* ============================================
   Frances Study App — Tema Francia 🇫🇷
   Colores: Azul #002395, Blanco, Rojo #ED2939
   ============================================ */

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

body {
  font-family: 'Segoe UI', 'Arial Rounded MT Bold', Arial, sans-serif;
  background: linear-gradient(135deg, #e8f0fe 0%, #fff 50%, #fde8e8 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: #002395;
  margin-bottom: 8px;
}
h2 {
  font-size: 1.6rem;
  text-align: center;
  color: #002395;
  margin-bottom: 16px;
}
h3 {
  font-size: 1.25rem;
  color: #002395;
  margin: 20px 0 8px;
  border-bottom: 2px solid #002395;
  padding-bottom: 4px;
}
h4 {
  font-size: 1.05rem;
  color: #ED2939;
  margin: 12px 0 6px;
}
.subtitle {
  text-align: center;
  font-size: 1.15rem;
  color: #555;
  margin-bottom: 24px;
}

/* ---- Topic Cards (pantalla principal) ---- */
.topic-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.topic-card {
  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;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.topic-card:hover,
.topic-card:focus {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  outline: 3px solid #002395;
}
.topic-card--blue {
  background: linear-gradient(135deg, #002395, #1a47b8);
  color: #fff;
}
.topic-card--red {
  background: linear-gradient(135deg, #ED2939, #ff5c6a);
  color: #fff;
}
.topic-emoji { font-size: 2.5rem; }
.topic-title { font-size: 1.3rem; font-weight: 700; }
.topic-desc  { font-size: 0.95rem; opacity: 0.9; text-align: center; }

/* ---- Menu Grid ---- */
.menu-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}
.menu-btn {
  padding: 16px 20px;
  font-size: 1.15rem;
  font-family: inherit;
  border: 2px solid #002395;
  border-radius: 12px;
  background: #fff;
  color: #002395;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.menu-btn:hover,
.menu-btn:focus {
  background: #002395;
  color: #fff;
  outline: none;
}

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

/* ---- Score Display ---- */
.score-display {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: #002395;
  background: #e8f0fe;
  border-radius: 10px;
  padding: 8px 16px;
  margin-bottom: 16px;
  display: inline-block;
  width: 100%;
}

/* ---- Exercise Area ---- */
.exercise-area {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.exercise-question {
  font-size: 1.3rem;
  margin-bottom: 16px;
  color: #333;
}

/* ---- Image Container ---- */
.image-container {
  text-align: center;
  margin-bottom: 16px;
}
.image-container img {
  max-width: 280px;
  max-height: 280px;
  border-radius: 12px;
  border: 3px solid #ddd;
  object-fit: contain;
  background: #f9f9f9;
}

/* ---- Inputs ---- */
.input-group {
  margin-bottom: 16px;
}
.input-group label {
  display: block;
  font-size: 1rem;
  color: #555;
  margin-bottom: 6px;
}
.text-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.15rem;
  font-family: inherit;
  border: 2px solid #ccc;
  border-radius: 10px;
  transition: border-color 0.2s;
}
.text-input:focus {
  border-color: #002395;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,35,149,0.15);
}
.text-area {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.15rem;
  font-family: inherit;
  border: 2px solid #ccc;
  border-radius: 10px;
  resize: vertical;
  transition: border-color 0.2s;
}
.text-area:focus {
  border-color: #002395;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,35,149,0.15);
}

/* ---- Feedback correct/incorrect ---- */
.input-correct {
  border-color: #2e7d32 !important;
  background: #e8f5e9 !important;
}
.input-incorrect {
  border-color: #c62828 !important;
  background: #ffebee !important;
}

/* ---- Options (radio buttons) ---- */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 1.1rem;
  border: 2px solid #ddd;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.option-label:hover {
  border-color: #002395;
  background: #f0f4ff;
}
.option-label input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #002395;
}
.option-correct {
  border-color: #2e7d32 !important;
  background: #e8f5e9 !important;
}
.option-incorrect {
  border-color: #c62828 !important;
  background: #ffebee !important;
}

/* ---- Match Exercise ---- */
.match-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.match-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.match-left {
  flex: 1;
  padding: 10px 14px;
  background: #e8f0fe;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
}
.match-select {
  flex: 1;
  padding: 10px 14px;
  font-size: 1.05rem;
  font-family: inherit;
  border: 2px solid #ccc;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.match-select:focus {
  border-color: #002395;
  outline: none;
}
.match-correct .match-select {
  border-color: #2e7d32;
  background: #e8f5e9;
}
.match-incorrect .match-select {
  border-color: #c62828;
  background: #ffebee;
}

/* ---- Feedback Messages ---- */
.feedback {
  min-height: 24px;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  border-radius: 8px;
  padding: 8px;
}
.feedback-correct {
  color: #2e7d32;
  background: #e8f5e9;
}
.feedback-incorrect {
  color: #c62828;
  background: #ffebee;
}

/* ---- 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: #002395;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover,
.btn-primary:focus {
  background: #001a6e;
  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: #ED2939;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-next:hover,
.btn-next:focus {
  background: #c41e2a;
  outline: none;
}
.btn-next:active {
  transform: scale(0.97);
}
.btn-listen {
  padding: 12px 28px;
  font-size: 1.15rem;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: #ff9800;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-listen:hover,
.btn-listen:focus {
  background: #e68900;
  outline: none;
}
.btn-listen:active {
  transform: scale(0.97);
}

.hidden {
  display: none !important;
}

/* ---- Guide Content ---- */
.guide-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.guide-box {
  background: #f5f7ff;
  border-left: 4px solid #002395;
  border-radius: 8px;
  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 hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 10px 0;
}

/* ---- Vocabulary Tables ---- */
.vocab-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 1.05rem;
}
.vocab-table th {
  background: #002395;
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}
.vocab-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #eee;
}
.vocab-table tr:nth-child(even) td {
  background: #f9f9f9;
}

/* ---- Conjugation Tables Side by Side ---- */
.conjugation-tables {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.conj-table {
  flex: 1;
  min-width: 220px;
}

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

  .topic-card {
    width: 100%;
  }
  .topic-cards {
    flex-direction: column;
    align-items: center;
  }

  .exercise-area {
    padding: 16px;
  }
  .image-container img {
    max-width: 200px;
    max-height: 200px;
  }

  .conjugation-tables {
    flex-direction: column;
  }

  .match-row {
    flex-direction: column;
    gap: 6px;
  }
  .match-left,
  .match-select {
    width: 100%;
    text-align: center;
  }

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

@media (min-width: 601px) and (max-width: 900px) {
  .topic-card {
    width: 180px;
  }
  .image-container img {
    max-width: 240px;
    max-height: 240px;
  }
}
