/* ============================================
   BIBLEFLUENT - INGLÉS BÍBLICO
   Estilos globales para todas las lecciones
   Diseño moderno, limpio y responsive
   Basado en el método ABA English
   ============================================ */

/* ---------- RESET Y BASE ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f6f9fc;
  color: #1e2a3a;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- HEADER (sticky) ---------- */
.site-header {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.7rem 0;
  gap: 0.8rem 1.5rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-icon {
  font-size: 1.8rem;
  color: #1f5f54;
}

.logo-text {
  font-weight: 700;
  font-size: 1.4rem;
  color: #0b2b3b;
  letter-spacing: -0.5px;
}

.logo-sub {
  font-size: 0.75rem;
  color: #5b6e8c;
  font-weight: 400;
  margin-left: 0.3rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
}

.nav-links a {
  text-decoration: none;
  color: #2c3e50;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.nav-links a:hover {
  color: #c6a43b;
}

.nav-links a.active {
  color: #1f5f54;
  font-weight: 600;
}

.social-icons-header {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.social-icons-header a {
  color: #5b6e8c;
  font-size: 1.1rem;
  transition: color 0.2s;
}

.social-icons-header a:hover {
  color: #c6a43b;
}

/* Responsive header */
@media (max-width: 900px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .logo-area {
    justify-content: center;
  }
  .nav-links {
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 0.4rem;
  }
  .social-icons-header {
    justify-content: center;
  }
}

/* ---------- HERO ---------- */
.hero {
  background: linear-gradient(135deg, #0b2b3b 0%, #1f5f54 100%);
  border-radius: 2rem;
  padding: 2rem 2rem 1.8rem;
  margin: 1.5rem 0 2rem;
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  letter-spacing: -0.5px;
}

.hero-badge {
  background: #f4b942;
  color: #1e2f3a;
  border-radius: 40px;
  padding: 0.2rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-block;
}

.hero p {
  margin-top: 0.3rem;
  opacity: 0.9;
  font-size: 1.05rem;
}

.progress-section {
  margin-top: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

.progress-bar-container {
  flex: 1;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  height: 8px;
  overflow: hidden;
  min-width: 120px;
}

.progress-fill {
  height: 100%;
  background: #f4b942;
  border-radius: 30px;
  transition: width 0.6s ease;
}

.stats {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.9;
}

.stats i {
  margin-right: 0.3rem;
}

@media (max-width: 700px) {
  .hero {
    padding: 1.5rem;
    border-radius: 1.2rem;
  }
  .hero h1 {
    font-size: 1.5rem;
  }
  .hero p {
    font-size: 0.95rem;
  }
}

/* ---------- ACORDEONES ---------- */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.accordion-item {
  background: white;
  border-radius: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid #e9edf2;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.accordion-item:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.accordion-header {
  background: white;
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1.15rem;
  transition: background 0.15s;
  user-select: none;
  gap: 1rem;
}

.accordion-header:hover {
  background: #f8fafc;
}

.accordion-header i:first-child {
  color: #1f5f54;
  margin-right: 0.6rem;
  width: 1.4rem;
  text-align: center;
}

.accordion-header .toggle-icon {
  color: #1f5f54;
  transition: transform 0.3s;
  font-size: 0.9rem;
}

.accordion-item.active .accordion-header .toggle-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  padding: 0 1.5rem;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  border-top: 0px solid #eef2f6;
}

.accordion-item.active .accordion-content {
  max-height: 5000px; /* suficiente para contenido extenso */
  padding: 0 1.5rem 2rem 1.5rem;
  border-top: 1px solid #eef2f6;
}

@media (max-width: 700px) {
  .accordion-header {
    font-size: 1rem;
    padding: 1rem;
  }
  .accordion-item.active .accordion-content {
    padding: 0 1rem 1.5rem 1rem;
  }
}

/* ---------- VERSÍCULO DESTACADO ---------- */
.verse-box {
  background: #f0f6fe;
  border-radius: 1rem;
  padding: 1.2rem;
  border-left: 6px solid #2c7a6e;
  margin: 1rem 0;
}

.verse-box .verse-ref {
  display: block;
  margin-top: 0.5rem;
  font-weight: 600;
  color: #2c7a6e;
}

/* ---------- TABLAS ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
  border-radius: 1rem;
  overflow: hidden;
}

th, td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

th {
  background: #eef3fa;
  font-weight: 600;
  color: #1e2a3a;
}

tr:last-child td {
  border-bottom: none;
}

@media (max-width: 600px) {
  table {
    font-size: 0.85rem;
  }
  th, td {
    padding: 0.5rem 0.6rem;
  }
}

/* ---------- TARJETAS DESTACADAS ---------- */
.card-highlight {
  background: #fef9e6;
  border-left: 6px solid #f4b942;
  padding: 1rem 1.2rem;
  border-radius: 1rem;
  margin: 1rem 0;
  color: #1e2a3a;
}

.rule-box {
  background: #eef3fa;
  padding: 1rem 1.2rem;
  border-radius: 1rem;
  margin: 1rem 0;
  border-left: 4px solid #1f5f54;
}

/* ---------- BOTONES ---------- */
.btn-reveal {
  background: #eef2fa;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #1e2a3a;
}

.btn-reveal i {
  font-size: 0.8rem;
}

.btn-reveal:hover {
  background: #dce5f0;
}

.btn-primary {
  background: #1f5f54;
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 2rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary:hover {
  background: #154b41;
}

.btn-check {
  background: #1f5f54;
  color: #fff;
  border: none;
  padding: 0.4rem 1.2rem;
  border-radius: 2rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-check:hover {
  background: #154b41;
}

.btn-check:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-reset-drag {
  background: #5b6e8c;
  color: #fff;
  border: none;
  padding: 0.4rem 1.2rem;
  border-radius: 2rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-reset-drag:hover {
  background: #3f4f66;
}

/* ---------- RESPUESTAS OCULTAS ---------- */
.answer-text {
  background: #edf4eb;
  padding: 0.8rem 1.2rem;
  border-radius: 1rem;
  margin-top: 0.8rem;
  display: none;
  border-left: 4px solid #3f9e6d;
  color: #1e2a3a;
}

.answer-text.show {
  display: block;
}

/* ---------- FEEDBACK ---------- */
.feedback-correct {
  color: #1f7b4d;
  font-weight: 500;
}

.feedback-wrong {
  color: #c2410c;
  font-weight: 500;
}

/* ---------- FLASHCARDS ---------- */
.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.flashcard {
  background: #f8fafc;
  border-radius: 1rem;
  padding: 1rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  border: 1px solid #e9edf2;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.flashcard:hover {
  background: #eef3fa;
  transform: scale(1.02);
}

.flashcard .en {
  font-size: 1.3rem;
  font-weight: 600;
}

.flashcard .es {
  display: none;
  font-size: 1rem;
  color: #2c3e50;
  margin-top: 0.3rem;
}

.flashcard.show .es {
  display: block;
}

.flashcard.show .en {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #f4b942;
}

/* ---------- QUIZ ---------- */
.quiz-option {
  background: #f1f5f9;
  border-radius: 3rem;
  padding: 0.5rem 1.2rem;
  margin: 0.4rem 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: inline-block;
  border: 2px solid transparent;
}

.quiz-option:hover {
  background: #e2eaf5;
}

.quiz-option.selected-correct {
  background: #b8e0c0;
  border-color: #1f7b4d;
}

.quiz-option.selected-wrong {
  background: #f4c2c2;
  border-color: #c2410c;
}

.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* ---------- EJERCICIO DE ARRASTRAR (DRAG & DROP) ---------- */
.drag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 1rem;
  border: 2px dashed #ccd8e6;
  min-height: 80px;
  align-items: center;
  justify-content: center;
}

.drag-item {
  background: #eef3fa;
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  cursor: grab;
  user-select: none;
  font-weight: 500;
  border: 1px solid #bcc8d8;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

.drag-item:hover {
  background: #dce5f0;
}

.drag-item:active {
  cursor: grabbing;
}

.drag-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.drag-item.dropped {
  background: #b8d9c0;
  border-color: #1f7b4d;
  cursor: default;
}

.drop-zone {
  background: #f0f6fe;
  border: 2px dashed #2c7a6e;
  border-radius: 1rem;
  padding: 0.8rem 1.2rem;
  min-height: 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0;
  transition: background 0.3s, border-color 0.3s;
}

.drop-zone.drag-over {
  background: #d4e8f0;
  border-color: #1f5f54;
}

.drop-zone .drag-item {
  cursor: default;
  background: #d4e2f0;
}

.drop-zone.correct {
  border-color: #1f7b4d;
  background: #d4edda;
}

.drop-zone.wrong {
  border-color: #c2410c;
  background: #f8d7da;
}

.drag-feedback {
  margin-top: 0.8rem;
  font-weight: 500;
}

/* ---------- EJEMPLOS EN CUADRÍCULA ---------- */
.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.example-item {
  background: #f8fafc;
  padding: 0.5rem 0.8rem;
  border-radius: 0.5rem;
  text-align: center;
  font-size: 0.95rem;
  border: 1px solid #e9edf2;
}

/* ---------- VIDEO ---------- */
.video-section {
  margin-bottom: 2rem;
}

.video-section iframe {
  border-radius: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* ---------- SCROLL TOP ---------- */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1f5f54;
  padding: 12px;
  border-radius: 50%;
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 48px;
  height: 48px;
  transition: background 0.2s, transform 0.2s;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scroll-top:hover {
  background: #154b41;
  transform: translateY(-3px);
}

.scroll-top i {
  font-size: 1.2rem;
}

/* ---------- FOOTER ---------- */
.main-footer {
  background: #111c16;
  color: #cdd9cf;
  text-align: center;
  padding: 2.5rem 1.5rem;
  margin-top: 3rem;
  border-top: 1px solid #2a3a2e;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.8rem;
  margin-bottom: 1.5rem;
}

.footer-links a {
  color: #e0d6c6;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #c6a43b;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-social a {
  color: #cdd9cf;
  font-size: 1.4rem;
  transition: color 0.2s;
}

.footer-social a:hover {
  color: #c6a43b;
}

.footer-copy {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ---------- UTILIDADES ---------- */
.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ---------- RESPONSIVE GENERAL ---------- */
@media (max-width: 700px) {
  .container {
    padding: 0 1rem;
  }
  .flashcard-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .example-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .drag-container {
    padding: 0.6rem;
    gap: 0.4rem;
  }
  .drop-zone {
    padding: 0.6rem;
    min-height: 50px;
  }
  .drag-item {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
  }
}

/* ---------- ACCESIBILIDAD ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- TEXTO DESTACADO ---------- */
.highlight-word {
  background: #eef3fa;
  padding: 0.1rem 0.4rem;
  border-radius: 12px;
  font-weight: 600;
}

.highlight-affirm {
  color: #1f7b4d;
  font-weight: 600;
}

.highlight-neg {
  color: #c2410c;
  font-weight: 600;
}

.highlight-quest {
  color: #1f5f54;
  font-weight: 600;
}

/* ---------- TTS BUTTONS ---------- */
.tts-btn {
  background: none;
  border: none;
  color: #1f5f54;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  transition: color 0.2s;
  vertical-align: middle;
  border-radius: 50%;
  line-height: 1;
}

.tts-btn:hover {
  color: #f4b942;
  background: rgba(31, 95, 84, 0.08);
}

.tts-btn.playing {
  color: #c2410c;
  animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ---------- TABLA DE VOCABULARIO CON TTS ---------- */
#vocabTable td:last-child {
  text-align: center;
  white-space: nowrap;
}

/* ---------- INPUTS Y FORMULARIOS ---------- */
.input-answer {
  padding: 0.4rem 0.8rem;
  border: 1px solid #ccd8e6;
  border-radius: 2rem;
  font-size: 0.95rem;
  width: 100%;
  max-width: 260px;
  transition: border-color 0.2s;
}

.input-answer:focus {
  outline: none;
  border-color: #1f5f54;
  box-shadow: 0 0 0 3px rgba(31, 95, 84, 0.15);
}

/* ---------- ESTILOS PARA EL DOBLAJE (INTERPRET) ---------- */
.dialogue-line {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9edf2;
}

.dialogue-line:last-child {
  border-bottom: none;
}

.dialogue-speaker {
  font-weight: 600;
  color: #1f5f54;
  display: inline-block;
  min-width: 70px;
}