/* ==========================================================================
   EarthLens — Estilos del Explorador y Mapa Interactivo (explorer.css)
   Responsable: 02 / Mapa interactivo y explorador
   ========================================================================== */

:root {
  --explorer-accent: #00b4d8;
  --explorer-primary: #0d6efd;
  --explorer-dark: #0b132b;
  --explorer-border: #e2e8f0;
  --explorer-surface: #ffffff;
}

/* Cabecera del Explorador y barra de pasos */
.explorer-header {
  background: linear-gradient(135deg, #0b132b 0%, #1c2541 60%, #1e3a5f 100%);
  color: #ffffff;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.workflow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.workflow-step {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.workflow-step.active {
  background: rgba(0, 180, 216, 0.22);
  color: #ffffff;
  border-color: #00b4d8;
  font-weight: 600;
}

.workflow-step .step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.workflow-step.active .step-num {
  background: #00b4d8;
  color: #0b132b;
}

/* Contenedor del Mapa Leaflet */
.map-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--explorer-border);
  background: #dbeafe;
  box-shadow: 0 4px 20px rgba(11, 19, 43, 0.08);
}

#explorer-map {
  width: 100%;
  height: 540px;
  z-index: 1;
}

/* Overlay flotante sobre el mapa */
.map-overlay-top {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-width: calc(100% - 70px);
  justify-content: flex-end;
}

.map-overlay-bottom {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 500;
  background: rgba(11, 19, 43, 0.88);
  backdrop-filter: blur(6px);
  color: #ffffff;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.coord-pill {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.82rem;
  color: #90e0ef;
  font-weight: 600;
}

/* Botones de ubicaciones rápidas y misiones */
.preset-chip {
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.preset-chip:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0369a1;
}

.preset-chip.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

/* Selector de variable enriquecido */
.variable-info-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--explorer-accent);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font-size: 0.84rem;
}

.variable-code-tag {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

/* Panel lateral de configuración */
.config-panel {
  background: var(--explorer-surface);
  border: 1px solid var(--explorer-border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(11, 19, 43, 0.06);
}

.config-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Botón principal Analizar */
.btn-analyze {
  background: linear-gradient(135deg, #0d6efd 0%, #0284c7 100%);
  border: none;
  color: #ffffff;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-analyze:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(13, 110, 253, 0.35);
  color: #ffffff;
}

.btn-analyze:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Vista previa de resultados / Paso a resultados */
.analysis-preview-card {
  border-top: 4px solid #0d6efd;
  animation: fadeInSlide 0.25s ease-out;
}

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

.stat-mini-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  height: 100%;
}

.stat-mini-label {
  font-size: 0.74rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
}

.stat-mini-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

/* Popup personalizado de Leaflet */
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
}

.earthlens-popup-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.earthlens-popup-coords {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.8rem;
  color: #0284c7;
  margin-bottom: 0.3rem;
}

.earthlens-popup-note {
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.35;
}

/* Adaptación móvil */
@media (max-width: 991.98px) {
  #explorer-map {
    height: 380px;
  }
}

@media (max-width: 575.98px) {
  #explorer-map {
    height: 320px;
  }
  .map-overlay-bottom {
    left: 8px;
    right: 8px;
    bottom: 8px;
    font-size: 0.74rem;
    justify-content: space-between;
  }
}
