/* =======================
   VARIABLES PRINCIPALES
======================= */
:root {
  --font-title: 'Cinzel', sans-serif;
  --font-subtitle: 'Lora', sans-serif;
  --font-ui: 'Montserrat', sans-serif;

  --base: #f7f5f1;
  --content: #2e316b;
  --content-light: #2e316b;
  --content-dark: #1c1e3a;

  --accent: #2e316b;
  --accent-light: #f7f5f1;
  --accent-dark: #c7a86d;

  --quiz-correct: #4CAF50;
  --quiz-wrong: #E53935;
  
  /* Variables compartidas para Drag & Drop e Image Pairing */
  --drag-bg: #f7f5f1;
  --drag-border: #2e316b;
  --drag-border-hover: #2e316b;
  --drag-correct: #4a7a3a;
  --drag-incorrect: #c44a4a;
}

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

/* =======================
   BASE GLOBAL MEDIA
======================= */
img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

@font-face {
  font-family: 'Cinzel';
  src: url('../fonts/cinzel/Cinzel-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora/Lora-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/montserrat/Montserrat-Regular.ttf') format('truetype');
}

body {
  font-family: var(--font-ui);
  background-color: var(--base);
  color: var(--content);
  line-height: 1.6;
  text-decoration: none;
  width: 100%;
}

main {
  width: 90%;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 1rem;
  align-items: center;
}

/* =======================
   HERO (header index)
======================= */
.hero {
  position: relative;
  width: 100%;
  height: 60dvh;
  background: url('../assets/hero.webp') center/cover no-repeat;
  display: flex;
  justify-content: center;
  color: var(--base);
  margin-bottom: 1rem;
}

.hero > div {
  background: rgba(0,0,0,0.72);
  padding: 1rem 2rem;
  border-radius: 12px;
}

.hero h1 {
  font-family: var(--font-title);
  font-size: 3.5rem;
  font-style: italic;
  margin: 0;
  color: var(--accent-light);
}

.hero p {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  margin-top: 1rem;
  color: var(--accent-light);
  text-decoration: none;
}

/* =======================
   HEADER rutas y stops
======================= */
header {
  width: 100%;
  background-color: var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  height: 150px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  flex-wrap: wrap;
  gap: 1rem;
}

header img.logo,
.route-header .route-logo {
  height: 80px;
  flex-shrink: 0;
}

.back-btn-header {
  text-decoration: none;
  background-color: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-block;
}

.back-btn-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

/* =======================
   TITULOS Y PARÁGRAFOS
======================= */
h1 {
  font-size: 2.5rem;
  color: var(--content-dark);
  margin-bottom: 0.5rem;
  text-align: left;
  font-family: var(--font-title);
}

h2 {
  font-family: var(--font-subtitle);
  font-size: 2rem;
  color: var(--content-dark);
  margin-top: 1rem;
  margin-bottom: 1rem;
  text-align: left;
}

h3 {
  font-family: var(--font-subtitle);
  font-size: 1.5rem;
  color: var(--content-dark);
  margin-top: 1rem;
  margin-bottom: 2rem;
  text-align: left;
}

p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  text-align: left;
  font-family: var(--font-ui);
}

a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
}

.interes {
  font-size: .75rem;
  opacity: 50%;
}

/* =======================
   CONTENEDORES
======================= */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 0;
}

/* =======================
   STOP PAGE
======================= */
/* Contenedor de medios (fotos y vídeos) */
.stop-visual > img,
.stop-visual > video {
  max-width: min(90%, 800px);
  border-radius: 12px;
  margin: 0 auto;
  margin-bottom: 2rem;
  width: auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

/* Contenedor de panorámicas (Pannellum) */
.stop-visual #panorama {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  object-fit: cover;
  height: 550px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

/* Juxtapose */
.container.stop-slider .jx-component {
  width: 100%;
  max-width: 100%;
  height: 400px;
  margin: 1.5rem auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.stop-visual .caption {
  font-size: 0.9rem;
  color: var(--content-light);
  text-align: center;
  margin: 2rem 0;
}

.stop-list {
  list-style: disc inside;
  margin-left: 1.5rem;
  color: var(--content-dark);
}

/* =======================
   RUTAS GRID
======================= */

.container.stops {
  width: 90%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem auto;
}

.routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: clamp(1rem, 4vw, 2rem);
}

.route-card {
  display: block;
  background: var(--base);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.route-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.route-card img {
  width: 100%;
  object-fit: cover;
}

.route-content {
  padding: 1.5rem;
  margin-left: 1.25rem;
}

.route-content h3 {
  font-family: var(--font-title);
  font-size: 20px;
  font-style: italic;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--content-dark);
}

.route-features {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.route-features li {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.route-features li svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  stroke: var(--content-dark);
  fill: #f7f5f1;
  stroke-width: 2;
}

/* =======================
   STOP CARDS
======================= */

.stop-card {
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease, max-height 0.6s ease;
  display: flex;
  align-items:center;
  gap: 1.5rem;
  background: var(--base);
  padding: 1rem;
  border-radius: 12px;
  border-left: 6px solid ;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  text-decoration: none;
}

.stop-card h3 {
  font-family: var(--font-title);
  color: var(--content-dark);
  margin-bottom: 0.1rem;
  font-size: 1.5rem;
}

.stop-card p {
  color: var(--content-dark);
  text-align: left;
  font-size: .9rem;

}

.stop-card.visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 200px;
  min-width: none;
  flex: 1 1 auto;
}

.stop-card .padlock {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.stop-card.unlocked {
  border-left-color: var(--accent-dark);
}

.stop-card:hover {
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

/* =======================
   QUIZ / AUDIO ACTIVITY
======================= */
.quiz-buttons {
  padding: 0.1rem 0.1rem;
  margin-right: 0.1rem;
  margin-bottom: 0.1rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-family: var(--font-ui);
}

.quiz-buttons p {
  font-size: 0.9rem;
  font-weight: 300;
  margin: 0;
  text-align: center;
  font-family: var(--font-ui);
}

.stop-activity audio {
  width: 80%;
  max-width: 250px;
  margin: 0.2rem 0;
  align-items: center;
  color: var(--content-dark);
}

#quiz-result {
  font-weight: bold;
  margin-top: 0.5rem;
}

/* =======================
   FOOTER
======================= */
.footer {
  text-align: center;
  padding: 1rem 0;
  font-size: 0.8rem;
  color: var(--content-light);
}

.footer p {
  text-align: center;
}

.footer-btn {
  display: block;
  text-align: center;
  margin: 2rem auto;
  background-color: var(--accent);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-btn {
  text-align: center;
  justify-content: center;
  background-color: var(--accent);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-btn a {
  color: var(--base);
  text-decoration: none;
}

.footer-btn a {
  color: var(--base);
  text-decoration: none;
}

.footer-btn:hover,
.info-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

/* =======================
   RESPONSIVE
======================= */
@media (max-width: 768px) {
  .stop-visual{
    width: auto;
    align-items: center;
  }

  .hotspot-text,
  .hotspot-component,
  .two-column-wrapper-test {
    width: 100%;
    min-width: auto;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

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

  .body {
    max-width: 100%;
  }

  .route-logo {
    height: 80px;
  }
}
/* =======================
   DRAG AND DROP ACTIVITY
======================= */

.drag-intro {
  background: var(--accent-light);
  padding: 1rem 1.5rem;
  border-left: 6px solid var(--accent);
  font-weight: 500;
  color: var(--content-dark);
}

.drag-area {
  position: relative;
  background: #f7f5f1;
  margin: 1.5rem;
  border-radius: 16px;
  overflow: visible; /* Cambiado de hidden a visible */
  display: flex;
  flex-direction: column;
}

.drag-area img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.drag-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.dropzone {
  position: absolute;
  border-radius: 12px;
  transition: all 0.15s ease;
  pointer-events: auto;
  cursor: pointer;
}

.dropzone.filled-correct {
  background-color: rgba(76, 175, 80, 0.2);
  border-color: var(--quiz-correct);
}

.dropzone.filled-incorrect {
  background-color: rgba(229, 57, 53, 0.2);
  border-color: var(--quiz-wrong);
}

.draggable {
  background: linear-gradient(135deg, var(--accent-light), #f7f5f1);
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  cursor: grab;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border: 1px solid var(--accent);
  color: var(--content-dark);
  white-space: nowrap;
  z-index: 100;
  margin: 0.3rem;
  user-select: none;
  -webkit-user-select: none;
}

.draggable:active {
  cursor: grabbing;
}

.draggable.dragging {
  opacity: 0.5;
}

.draggable.placed {
  display: none;
}

/* NUEVO: Contenedor para los nombres arrastrables */
.drag-names-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  margin-top: 1rem;
  background: var(--accent-light);
  border-radius: 16px;
  width: 100%;
  min-height: 40px;
}

.placed-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--base);
  padding: 5px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

.placed-badge.correct {
  background: var(--quiz-correct);
}

.placed-badge.wrong {
  background: var(--quiz-wrong);
  text-decoration: line-through;
}

.drag-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--content-light);
}

.drag-actions button {
  background: var(--accent);
  color: var(--base);
  border: none;
  padding: 0.6rem 1.8rem;
  border-radius: 40px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-ui);
}

.drag-actions button:hover {
  background: var(--accent-dark);
  color: white;
  transform: translateY(-2px);
}

.drag-feedback {
  background: var(--content-dark);
  padding: 0.6rem 1.2rem;
  border-radius: 40px;
  font-weight: 500;
  color: var(--base);
  font-size: 0.9rem;
  flex: 1;
  text-align: center;
}

/* Clon de arrastre */
.dragging-clone {
  position: fixed !important;
  pointer-events: none !important;
  z-index: 99999 !important;
  opacity: 0.9 !important;
  transform: scale(1.05) !important;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
  margin: 0 !important;
  background: linear-gradient(135deg, #f7f5f1, #fff0dd) !important;
  border-radius: 20px !important;
  padding: 8px 16px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  text-align: center !important;
  color: var(--content-dark) !important;
  border: 1px solid var(--accent) !important;
  white-space: nowrap !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
}

@media (max-width: 768px) {
  .draggable {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  .placed-badge {
    font-size: 0.7rem;
    padding: 3px 10px;
  }
  .drag-actions {
    flex-direction: column;
  }
  .drag-names-container {
    padding: 0.8rem;
    gap: 0.4rem;
  }
}

/* =======================
   IMAGE PAIRING (COLUMNAS LADO A LADO)
======================= */

.image-pairing {
  margin: 1rem 0;
  font-family: var(--font-ui);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 100%;
}

/* CONTENEDOR PRINCIPAL QUE ENVUELVE LAS DOS COLUMNAS */
.image-pairing .columns-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  max-width: 800px;
  margin: 0 auto 1.5rem auto;
}

/* Columna izquierda: HUELLAS */
.image-pairing .left-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

/* Columna derecha: ANIMALES */
.image-pairing .right-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

/* Imágenes arrastrables (HUELLAS) */
.image-pairing .left-column .image-item {
  width: 150px;
  height: 150px;
  object-fit: fill;
  cursor: grab;
  background: var(--drag-bg);
  border: 3px dashed var(--drag-border);
  border-radius: 20%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  touch-action: none;
  user-select: none;
  padding: 0.5rem;
}

.image-pairing .left-column .image-item:hover {
  border-color: var(--drag-border-hover);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transform: scale(1.03);
  background: #f0e8dc;
}

.image-pairing .left-column .image-item.dragging {
  opacity: 0.4;
  transform: scale(0.98);
  cursor: grabbing;
}

/* Drop zones (ANIMALES) */
.image-pairing .right-column .drop-zone {
  width: 150px;
  height: 150px;
  object-fit: fill;
  background: var(--drag-bg);
  border: 3px dashed var(--drag-border);
  border-radius: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  position: relative;
  padding: 0.5rem;
}

.image-pairing .right-column .drop-zone .image-item {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  background: transparent;
  padding: 0;
  pointer-events: none;
}

.image-pairing .right-column .drop-zone.hover {
  border-color: var(--drag-correct);
  background: #e8f0e0;
  transform: scale(1.03);
}

/* Estados de feedback */
.image-pairing .right-column .drop-zone.correct {
  border-color: var(--drag-correct);
  background: #e0f0d8;
  border-style: solid;
}

.image-pairing .right-column .drop-zone.incorrect {
  border-color: var(--drag-incorrect);
  background: #f0e0d8;
  border-style: solid;
}

.image-pairing .right-column .drop-zone.correct .image-item,
.image-pairing .right-column .drop-zone.incorrect .image-item {
  opacity: 0.5;
  filter: grayscale(0.3);
}

/* Badges de feedback */
.image-pairing .right-column .drop-zone.correct::after,
.image-pairing .right-column .drop-zone.incorrect::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: bold;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  border: 2px solid;
}

.image-pairing .right-column .drop-zone.correct::after {
  content: '✓';
  color: var(--drag-correct);
  border-color: var(--drag-correct);
  background: #e0f0d8;
}

.image-pairing .right-column .drop-zone.incorrect::after {
  content: '✗';
  color: var(--drag-incorrect);
  border-color: var(--drag-incorrect);
  background: #f0e0d8;
}

/* Clon de arrastre */
.image-pairing .dragging-clone {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  object-fit: contain;
  opacity: 0.85;
  transform: scale(1.05);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
  background: var(--drag-bg);
  border: 3px dashed var(--drag-border);
  border-radius: 20%;
  padding: 1rem;
}

/* ========== BARRA DE CONTROLES ========== */
.image-pairing .drag-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--content-light);
  width: 100%;
  flex-direction: column;
  align-items: stretch;
}

.image-pairing .drag-feedback {
  background: var(--content-dark);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-weight: 500;
  color: var(--base);
  font-size: 0.9rem;
  flex: 1;
  text-align: center;
  min-width: 150px;
}

.image-pairing .drag-actions button {
  background: var(--accent);
  color: var(--base);
  border: none;
  padding: 0.6rem 1.8rem;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.image-pairing .drag-actions button:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(180, 138, 46, 0.2);
}

/* Ocultar los controles antiguos */
.image-pairing .controls {
  display: none;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
  .image-pairing .columns-row {
    gap: 1rem;
  }
  
  .image-pairing .left-column .image-item,
  .image-pairing .right-column .drop-zone {
    width: 120px;
    height: 120px;
    padding: 0.4rem;
  }
}

@media (max-width: 400px) {
  .image-pairing .columns-row {
    gap: 0.5rem;
  }
  
  .image-pairing .left-column .image-item,
  .image-pairing .right-column .drop-zone {
    width: 100px;
    height: 100px;
    padding: 0.3rem;
  }
}