/* ============================================================
   Integralog — Estilos Mapbox v3
   Satellite 3D · Popups de hitos · Timeline rich
   ============================================================ */

/* Ocultar atribución */
.mapboxgl-ctrl-logo   { display: none !important; }
.mapboxgl-ctrl-attrib { display: none !important; }

/* Marcadores del tracking map deben estar sobre el contenido */
#map .mapboxgl-marker { z-index: 5 !important; }

/* Controles de navegación — glass claro sobre el mapa */
.mapboxgl-ctrl-group {
  background: rgba(255,255,255,0.92) !important;
  border: 1px solid rgba(10,22,40,0.08) !important;
  border-radius: 10px !important;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(10,22,40,0.12) !important;
}
.mapboxgl-ctrl-group button {
  color: #334155 !important;
  background: transparent !important;
}
.mapboxgl-ctrl-group button:hover {
  background: rgba(10,22,40,0.06) !important;
  color: #0A1628 !important;
}

/* ============================================================
   HERO — barco y puertos sobre mapa satellite
   ============================================================ */

/* Barco animado: punto de luz verde pulsante */
.hero-ship {
  position: relative;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.hero-ship__core {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #B6FF4D;
  box-shadow: 0 0 0 4px rgba(154,230,0,0.35), 0 0 20px rgba(154,230,0,0.9);
  position: relative; z-index: 2;
}
.hero-ship__ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(154,230,0,0.65);
}
.hero-ship__ring.r1 { animation: shipRing 2s ease-out infinite; }
.hero-ship__ring.r2 { animation: shipRing 2s ease-out 0.7s infinite; }
@keyframes shipRing {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* Marcadores de puertos del hero */
.hero-port {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: default;
}
.hero-port__dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.75);
}
.hero-port--origin .hero-port__dot {
  background: #B6FF4D;
  box-shadow: 0 0 14px rgba(154,230,0,0.8);
}
.hero-port--dest .hero-port__dot {
  background: #FF8C00;
  box-shadow: 0 0 14px rgba(255,140,0,0.8);
}
.hero-port--hub .hero-port__dot {
  width: 10px; height: 10px;
  background: rgba(182, 255, 77, 0.95);
  border-color: rgba(255,255,255,0.5);
  box-shadow: 0 0 12px rgba(154,230,0,0.75);
  position: relative;
}
.hero-port--hub .hero-port__dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(154,230,0,0.6);
  animation: hubPulse 2.6s ease-out infinite;
}
.hero-port--hub .hero-port__label {
  font-size: 8px;
  padding: 1px 6px;
  opacity: 0.8;
  background: rgba(0,0,0,0.4);
}
@keyframes hubPulse {
  0%   { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(2.8); opacity: 0; }
}
.hero-port__label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  padding: 2px 8px; border-radius: 4px;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.15);
}

/* ============================================================
   TRACKING — marcadores con popup flotante
   ============================================================ */
.track-marker {
  position: relative;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  z-index: 5;
}
.track-marker__dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid rgba(255,255,255,0.5);
  font-size: 13px;
  position: relative; z-index: 2;
  transition: transform 0.2s ease;
}
.track-marker--done   .track-marker__dot { background: rgba(50,205,50,0.85);  border-color: #32CD32; box-shadow: 0 0 12px rgba(50,205,50,0.5); }
.track-marker--active .track-marker__dot { background: rgba(255,140,0,0.9);   border-color: #FF8C00; box-shadow: 0 0 16px rgba(255,140,0,0.7); }
.track-marker--pending .track-marker__dot { background: rgba(30,40,60,0.7);  border-color: rgba(255,255,255,0.25); }

.track-marker__pulse {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
}
.track-marker--active .track-marker__pulse {
  color: #FF8C00;
  animation: trackPulse 2s ease-out infinite;
}
@keyframes trackPulse {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}
.track-marker:hover .track-marker__dot { transform: scale(1.2); }

/* ── Popup Nativo (Soporte para Mapbox GL) ── */
.track-popup-container {
  z-index: 10 !important;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateY(8px);
}
.track-popup-container.is-visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.track-popup-container .mapboxgl-popup-content {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
.track-popup-container .mapboxgl-popup-tip {
  display: none !important; /* Usamos nuestro propio triángulo */
}

.track-popup {
  position: relative; /* Cambiado de absolute */
  width: 260px;
  background: rgba(10,14,24,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  z-index: 10;
}
.track-popup::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(10,14,24,0.92);
}
.track-popup--active {
  border-color: rgba(255,140,0,0.35);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(255,140,0,0.15);
}
.track-popup--done {
  border-color: rgba(50,205,50,0.25);
}

.track-popup__header {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px;
}
.track-popup__icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.track-popup__name {
  display: block; font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem; font-weight: 700; color: #f1f5f9; line-height: 1.3;
}
.track-popup__date {
  display: block; font-size: 0.7rem; color: #64748b;
  margin-top: 2px; letter-spacing: 0.04em;
}
.track-popup__badge {
  margin-left: auto; flex-shrink: 0;
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 100px;
  text-transform: uppercase; letter-spacing: 0.06em;
  align-self: flex-start;
}
.track-popup__badge--done    { background: rgba(50,205,50,0.15);  color: #4ade80; border: 1px solid rgba(50,205,50,0.3); }
.track-popup__badge--active  { background: rgba(255,140,0,0.15);  color: #fb923c; border: 1px solid rgba(255,140,0,0.3); }
.track-popup__badge--pending { background: rgba(148,163,184,0.1); color: #94a3b8; border: 1px solid rgba(148,163,184,0.2); }

.track-popup__detail {
  font-size: 0.75rem !important; color: #94a3b8 !important;
  line-height: 1.5 !important; margin: 0 !important;
  border-top: 1px solid rgba(255,255,255,0.07); padding-top: 8px;
}

/* Barco en tracking */
.map-ship {
  font-size: 22px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  filter: drop-shadow(0 0 8px rgba(255,140,0,0.6));
  animation: shipBob 2.5s ease-in-out infinite;
}
@keyframes shipBob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-4px) rotate(3deg); }
}

/* ============================================================
   TIMELINE RICA — panel derecho del tracking
   ============================================================ */
.tracking__timeline {
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  backdrop-filter: blur(8px);
}

/* Cabecera del panel */
.timeline__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.timeline__container-id {
  display: flex; align-items: center; gap: 7px;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.78rem; font-weight: 700;
  color: #334155; letter-spacing: 0.05em;
}
.timeline__container-id svg { color: #32CD32; }
.timeline__live-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: #32CD32;
  background: rgba(50,205,50,0.08);
  border: 1px solid rgba(50,205,50,0.2);
  padding: 3px 10px; border-radius: 100px;
}
.timeline__live-badge .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #32CD32;
  animation: pulse 2s infinite;
}

/* Items de la timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline__item {
  display: flex; gap: 14px;
  opacity: 0; transform: translateX(-12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: var(--tl-delay, 0s);
}
.timeline__item.tl-visible {
  opacity: 1; transform: translateX(0);
}

/* Columna izquierda: dot + línea */
.timeline__left {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0;
  padding-top: 4px;
}
.timeline__dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; position: relative; z-index: 1;
  flex-shrink: 0;
  border: 2px solid transparent;
}
.timeline__item.is-done   .timeline__dot { background: #f0fdf4; border-color: #32CD32; }
.timeline__item.is-active .timeline__dot { background: #fff7ed; border-color: #FF8C00; box-shadow: 0 0 0 4px rgba(255,140,0,0.12); }
.timeline__item:not(.is-done):not(.is-active) .timeline__dot { background: #f8fafc; border-color: #e0e0e0; }

.timeline__line {
  width: 2px; flex: 1; min-height: 20px;
  background: #E0E0E0; margin: 4px 0;
}
.timeline__item.is-done .timeline__line { background: linear-gradient(to bottom, #32CD32, #E0E0E0); }

/* Tarjeta del hito */
.timeline__card {
  flex: 1;
  background: #F8F9FA;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s ease;
}
.timeline__card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.timeline__card--active {
  background: #fffbf5;
  border-color: rgba(255,140,0,0.3);
  box-shadow: 0 0 0 1px rgba(255,140,0,0.1), 0 4px 16px rgba(255,140,0,0.08);
}
.timeline__card--pending { background: #fafafa; opacity: 0.7; }

.timeline__card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 5px;
}
.timeline__card-head strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem; font-weight: 700; color: #212529;
}
.timeline__card-location {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.78rem; color: #868E96; margin-bottom: 8px;
}
.timeline__card-location svg { color: #ADB5BD; flex-shrink: 0; }

.timeline__card-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
}
.timeline__card-meta > span:first-child {
  font-size: 0.72rem; color: #ADB5BD;
  letter-spacing: 0.04em; margin-right: 2px;
}

/* Chips de datos */
.tl-chip {
  font-size: 0.68rem; font-weight: 600;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.07);
  color: #495057;
  padding: 2px 8px; border-radius: 100px;
}
.timeline__card--active .tl-chip {
  background: rgba(255,140,0,0.07);
  border-color: rgba(255,140,0,0.2);
  color: #c26a00;
}

/* Badges de estado */
.tl-badge {
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 8px; border-radius: 100px;
  flex-shrink: 0;
}
.tl-badge--done    { background: rgba(50,205,50,0.1);  color: #28A428; border: 1px solid rgba(50,205,50,0.25); }
.tl-badge--active  { background: rgba(255,140,0,0.1);  color: #FF8C00; border: 1px solid rgba(255,140,0,0.3); }
.tl-badge--pending { background: rgba(148,163,184,0.1); color: #94a3b8; border: 1px solid rgba(148,163,184,0.2); }

/* Barra de progreso del hito activo */
.timeline__card-progress {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(255,140,0,0.15);
  display: flex; flex-direction: column; gap: 5px;
}
.timeline__card-progress span { font-size: 0.7rem; color: #868E96; }
.tl-progress-bar {
  height: 4px; background: rgba(255,140,0,0.15);
  border-radius: 2px; overflow: hidden;
}
.tl-progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #FF8C00, #FFB347);
  border-radius: 2px;
  animation: progressGrow 1.2s 0.8s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes progressGrow { to { width: 62%; } }

/* Navbar activo */
.navbar__links a.is-active { color: #28A428; font-weight: 600; }
