/* ==========================================================================
   ESTILOS - ECO-DETECTIVES (3.º GRADO DE PRIMARIA)
   Nodo Andino • Laboratorio de Ciencias Naturales
   ========================================================================== */

:root {
  --bg-primary: #f0fdf4;
  --panel-bg: #ffffff;
  --color-brand: #059669;
  --color-brand-dark: #065f46;
  --color-water: #0284c7;
  --color-earth: #78350f;
  --color-gold: #f59e0b;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  
  --font-main: 'Fredoka', 'Quicksand', system-ui, sans-serif;
  --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.06);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08);
}

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

body {
  font-family: var(--font-main);
  background: linear-gradient(135deg, #ecfdf5 0%, #e0f2fe 100%);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   HEADER CIENTÍFICO CON TIMER DE 30 MINUTOS
   ========================================================================== */
.lab-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid #6ee7b7;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.brand-titles h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-brand-dark);
  line-height: 1.1;
}

.brand-titles span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0369a1;
}

/* Timer y Puntos */
.header-indicators {
  display: flex;
  align-items: center;
  gap: 16px;
}

.timer-box {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 20px;
  padding: 4px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
}

.timer-box.timer-warning {
  border-color: #ef4444;
  background: #fef2f2;
  color: #dc2626;
  animation: pulse 1s infinite alternate;
}

.timer-clock {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.btn-timer-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  font-size: 0.9rem;
  padding: 2px;
}

.btn-timer-toggle:hover {
  color: var(--color-brand);
}

.score-box {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 2px solid #fde68a;
  border-radius: 20px;
  padding: 4px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 800;
  color: #b45309;
}

/* Botones de acción */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-lab-ctrl {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 6px 12px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-lab-ctrl:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-lab-ctrl.fullscreen {
  background: linear-gradient(135deg, #fef08a, #fde047);
  border-color: #eab308;
  color: #713f12;
}

/* ==========================================================================
   NAVEGACIÓN POR ESTACIONES (TABS)
   ========================================================================== */
.stations-navbar {
  max-width: 1100px;
  width: 95%;
  margin: 16px auto 0 auto;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.station-tab-btn {
  flex: 1;
  max-width: 320px;
  background: #ffffff;
  border: 3px solid #e2e8f0;
  border-radius: 18px;
  padding: 10px 14px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.station-tab-btn:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
}

.station-tab-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #047857;
  color: #ffffff;
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.station-icon {
  font-size: 1.5rem;
}

.station-tab-btn.completed::after {
  content: '✓';
  margin-left: auto;
  background: #ffffff;
  color: #059669;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL
   ========================================================================== */
.lab-main-container {
  max-width: 1100px;
  width: 95%;
  margin: 16px auto 30px auto;
  flex: 1;
  position: relative;
}

.station-view-panel {
  display: none;
  background: #ffffff;
  border: 3px solid #e2e8f0;
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.3s ease;
}

.station-view-panel.active {
  display: block;
}

.panel-header-title {
  margin-bottom: 18px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header-title h2 {
  font-size: 1.4rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header-title p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ==========================================================================
   ESTACIÓN 1: SIMULADOR DEL CICLO DEL AGUA
   ========================================================================== */
.water-sim-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
}

.sim-stage-canvas-box {
  background: linear-gradient(180deg, #38bdf8 0%, #bae6fd 60%, #86efac 75%, #78350f 100%);
  border: 4px solid #0284c7;
  border-radius: 24px;
  height: 380px;
  position: relative;
  overflow: hidden;
}

/* Elementos del simulador */
.sim-sun-node {
  position: absolute;
  top: 15px;
  left: 20px;
  width: 70px;
  height: 70px;
  background: radial-gradient(circle, #fde047 30%, #f59e0b 100%);
  border-radius: 50%;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.sim-cloud-node {
  position: absolute;
  top: 30px;
  right: 50px;
  width: 140px;
  height: 60px;
  background: #ffffff;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 8px 20px rgba(0, 100, 180, 0.15);
  cursor: pointer;
}

.sim-steam-particles {
  position: absolute;
  bottom: 120px;
  left: 180px;
  display: flex;
  gap: 15px;
  font-size: 1.5rem;
  animation: vaporRise 2s infinite;
}

.sim-rain-shower {
  position: absolute;
  top: 90px;
  right: 70px;
  width: 100px;
  height: 120px;
  pointer-events: none;
  display: none;
}

.sim-rain-shower.active {
  display: block;
}

.sim-rain-drop {
  position: absolute;
  width: 3px;
  height: 16px;
  background: #0284c7;
  border-radius: 3px;
  animation: rainDrop 0.5s linear infinite;
}

/* Zonas de entrega de etiquetas (Dropzones) */
.dropzone-tag {
  position: absolute;
  background: rgba(255, 255, 255, 0.88);
  border: 2px dashed #0284c7;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0369a1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 130px;
  justify-content: center;
  transition: all 0.2s ease;
}

.dropzone-tag.dz-evap { top: 140px; left: 60px; }
.dropzone-tag.dz-cond { top: 95px; right: 40px; }
.dropzone-tag.dz-prec { top: 210px; right: 50px; }
.dropzone-tag.dz-infil { bottom: 25px; left: 160px; }

.dropzone-tag.filled {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
  border-style: solid;
}

/* Panel Lateral de Etiquetas Arrastrables */
.sim-controls-panel {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sim-controls-panel h3 {
  font-size: 1rem;
  color: #334155;
}

.draggable-concept-chip {
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0369a1;
  cursor: grab;
  box-shadow: 0 3px 6px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease;
}

.draggable-concept-chip:hover {
  transform: translateY(-2px);
  background: #f0f9ff;
}

.draggable-concept-chip:active, .draggable-concept-chip.dragging {
  cursor: grabbing;
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.btn-trigger-action {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 10px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}

/* ==========================================================================
   ESTACIÓN 2: EL SUELO VIVO Y LOS DESCOMPONEDORES
   ========================================================================== */
.soil-lab-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.soil-sorter-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.waste-items-pool {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.waste-item-chip {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: grab;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  transition: all 0.15s ease;
}

.waste-item-chip:hover {
  transform: scale(1.05);
  border-color: #10b981;
}

.drop-containers-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.bin-drop-target {
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.bin-drop-target.organic {
  background: #f0fdf4;
  border: 3px dashed #22c55e;
  color: #15803d;
}

.bin-drop-target.recyclable {
  background: #eff6ff;
  border: 3px dashed #3b82f6;
  color: #1d4ed8;
}

.bin-drop-target.highlight {
  transform: scale(1.04);
  background: #fef08a;
  border-color: #eab308;
}

/* Corte de capas del suelo */
.soil-profile-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.soil-layers-stack {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid #3e2723;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.soil-layer {
  padding: 10px 14px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 700;
}

.soil-layer.layer-o { background: #3e2723; color: #fde047; }
.soil-layer.layer-a { background: #5d4037; }
.soil-layer.layer-b { background: #8d6e63; }
.soil-layer.layer-c { background: #b0bec5; color: #1e293b; }

/* ==========================================================================
   ESTACIÓN 3: TRIVIA RELÁMPAGO Y TICKET DE SALIDA
   ========================================================================== */
.quiz-station-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quiz-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 20px;
}

.quiz-question-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 14px;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-opt-btn {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  padding: 12px 18px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-opt-btn:hover {
  background: #f1f5f9;
  border-color: #0284c7;
}

.quiz-opt-btn.correct {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
}

.quiz-opt-btn.wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}

/* Ticket de Salida */
.exit-ticket-box {
  background: linear-gradient(135deg, #f0fdf4, #e0f2fe);
  border: 3px solid #86efac;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ticket-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ticket-field label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #166534;
}

.ticket-field input, .ticket-field textarea {
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 10px 14px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
}

.btn-finish-mission {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  border-radius: 18px;
  padding: 14px 24px;
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  align-self: flex-start;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   MODAL DE DIPLOMA CIENTÍFICO FINAL
   ========================================================================== */
.diploma-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.diploma-modal-backdrop.active {
  display: flex;
}

.diploma-cert-card {
  background: #ffffff;
  border: 8px solid #f59e0b;
  border-radius: 32px;
  padding: 30px 40px;
  max-width: 650px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes vaporRise {
  0% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-30px); opacity: 1; }
  100% { transform: translateY(-60px); opacity: 0; }
}

@keyframes rainDrop {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(100px); opacity: 0; }
}

@keyframes pulse {
  0% { opacity: 0.8; }
  100% { opacity: 1; }
}

@media (max-width: 850px) {
  .water-sim-layout, .soil-lab-layout {
    grid-template-columns: 1fr;
  }
}
