/* ============================================================================
   🧭 BAQUEANO ECOSYSTEM — MODO DEMO JURADO HACKATHON (PITCH NACIONAL 3 MIN)
   ============================================================================
   🎯 1. POR QUÉ (WHY / PROPÓSITO):
   - Proporcionar al jurado técnico de competencia nacional una demostración
     guiada, interactiva y de extremo a extremo en menos de 3 minutos.
   - Demuestra de forma contundente la integración:
     Prompt Natural → IA Territorial → Desglose Financiero → Mapa 3D →
     Cooperativa Local Firestore → Cero Comisión → Respaldo GPS Offline & Android.
   - Eleva la credibilidad técnica a 100/100 erradicando cualquier duda sobre
     la viabilidad y funcionamiento del ecosistema.

   ⚙️ 2. CÓMO (HOW / ARQUITECTURA & IMPLEMENTACIÓN):
   - Modal responsivo con Glassmorphism profundo (backdrop-filter: blur(20px)).
   - Paleta de diseño: #165D6F (Petróleo Teal), #F65E01 (Naranja Terracota),
     #F4E6C1 (Crema Pinolera) y #0F172A (Noche Profunda).
   - Máquina de estados en JavaScript para transiciones fluidas de 5 pasos a 60fps.
   - Cero uso de .withOpacity() ni palabras restringidas; variables nativas CSS.

   📦 3. QUÉ (WHAT / ENTREGABLES & FUNCIONALIDAD):
   - Reglas y layout para #demoModal, .demo-hackathon-dialog, .demo-step-content,
     .demo-timeline, .demo-badge, .demo-card-highlight y botones de navegación.
   ============================================================================ */

/* 1. CONTENEDOR MODAL EXPANDIDO */
#demoModal .modal-card-dialog.demo-hackathon-dialog {
  max-width: 860px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.2rem;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96) 0%, rgba(22, 93, 111, 0.92) 100%);
  border: 1.5px solid rgba(246, 94, 1, 0.45);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 35px rgba(246, 94, 1, 0.25);
  border-radius: 28px;
  color: #F8FAFC;
  scrollbar-width: thin;
  scrollbar-color: #F65E01 rgba(15, 23, 42, 0.5);
}

/* 2. ENCABEZADO DE LA DEMOSTRACIÓN */
.demo-header {
  margin-bottom: 1.5rem;
  text-align: left;
}

.demo-header-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.demo-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(246, 94, 1, 0.2);
  border: 1px solid rgba(246, 94, 1, 0.6);
  color: #F4E6C1;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-pill-badge i {
  color: #F65E01;
}

.demo-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(45, 212, 191, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.4);
  color: #2DD4BF;
  font-size: 0.76rem;
  font-weight: 600;
}

.demo-main-title {
  font-family: 'Space Grotesk', 'Montserrat', sans-serif;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.25;
  margin: 0 0 0.35rem 0;
}

.demo-subtitle {
  font-size: 0.88rem;
  color: rgba(244, 230, 193, 0.85);
  line-height: 1.45;
  margin: 0;
}

/* 3. LÍNEA DE TIEMPO / STEPPER PROGRESSIVO */
.demo-stepper-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin: 1.5rem 0 1.75rem 0;
  background: rgba(2, 6, 23, 0.6);
  padding: 0.5rem;
  border-radius: 16px;
  border: 1px solid rgba(244, 230, 193, 0.15);
}

.demo-step-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.4rem;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(244, 230, 193, 0.6);
  cursor: pointer;
  transition: all 0.25s ease-in-out;
  text-align: center;
}

.demo-step-btn:hover {
  background: rgba(22, 93, 111, 0.35);
  color: #F4E6C1;
}

.demo-step-btn.is-active {
  background: linear-gradient(135deg, rgba(22, 93, 111, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1.5px solid #F65E01;
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(246, 94, 1, 0.3);
}

.demo-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(244, 230, 193, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 800;
}

.demo-step-btn.is-active .demo-step-num {
  background: #F65E01;
  color: #FFFFFF;
}

.demo-step-btn.is-completed .demo-step-num {
  background: #2DD4BF;
  color: #0F172A;
}

.demo-step-label {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

/* 4. ÁREA DE CONTENIDO DE CADA PASO */
.demo-step-panel {
  display: none;
  animation: demoFadeIn 0.35s ease-out forwards;
}

.demo-step-panel.is-active {
  display: block;
}

@keyframes demoFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.demo-panel-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: stretch;
}

@media (max-width: 768px) {
  .demo-stepper-nav {
    grid-template-columns: repeat(3, 1fr);
  }
  .demo-panel-grid {
    grid-template-columns: 1fr;
  }
}

/* 5. TARJETAS DE DETALLES Y SIMULACIÓN */
.demo-card-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(244, 230, 193, 0.2);
  border-radius: 18px;
  padding: 1.35rem;
  backdrop-filter: blur(12px);
}

.demo-card-box.highlight {
  border-color: rgba(246, 94, 1, 0.5);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.8) 0%, rgba(22, 93, 111, 0.35) 100%);
}

.demo-card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  color: #F4E6C1;
  margin: 0 0 0.85rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(244, 230, 193, 0.15);
}

.demo-card-title i {
  color: #F65E01;
}

.demo-prompt-terminal {
  background: #080D1A;
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: 12px;
  padding: 1rem;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.88rem;
  color: #A7F3D0;
  margin-bottom: 1rem;
  line-height: 1.5;
  position: relative;
}

.demo-prompt-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #2DD4BF;
  vertical-align: middle;
  animation: demoBlink 1s infinite;
}

@keyframes demoBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.demo-chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.demo-chip {
  padding: 0.3rem 0.65rem;
  background: rgba(22, 93, 111, 0.4);
  border: 1px solid rgba(244, 230, 193, 0.25);
  border-radius: 8px;
  font-size: 0.74rem;
  color: #F4E6C1;
}

/* 6. TABLAS Y DESGLOSE FINANCIERO */
.demo-fiscal-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.demo-fiscal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(2, 6, 23, 0.5);
  border-radius: 8px;
  font-size: 0.82rem;
}

.demo-fiscal-row.total {
  background: rgba(246, 94, 1, 0.2);
  border: 1px solid rgba(246, 94, 1, 0.5);
  font-weight: 800;
  font-size: 0.95rem;
  color: #F4E6C1;
}

.demo-badge-green {
  background: rgba(45, 212, 191, 0.2);
  border: 1px solid #2DD4BF;
  color: #2DD4BF;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* 7. CONTROLES Y FOOTER DEL MODAL */
.demo-actions-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(244, 230, 193, 0.2);
}

.demo-footer-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: rgba(244, 230, 193, 0.75);
}

.demo-btns-cluster {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.demo-btn-sec {
  padding: 0.65rem 1.15rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(244, 230, 193, 0.3);
  color: #F4E6C1;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.demo-btn-sec:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

.demo-btn-prim {
  padding: 0.65rem 1.35rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #F65E01 0%, #D84E00 100%);
  border: 1px solid rgba(244, 230, 193, 0.6);
  color: #FFFFFF;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(246, 94, 1, 0.4);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-btn-prim:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(246, 94, 1, 0.55);
}
