/* CancúnSafe – estilos del mapa */
#csf-wrap {
  display: grid;
  grid-template-columns: 290px 1fr;
  height: 620px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

/* ── SIDEBAR ── */
#csf-sidebar {
  background: #fff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#csf-sb-top {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#csf-logo {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.4px;
  color: #0f172a;
}
#csf-logo span { color: #059669; }
#csf-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 4px 10px;
}
#csf-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #059669;
  animation: csf-pulse 2s infinite;
}
@keyframes csf-pulse {
  0%,100%{opacity:1;transform:scale(1)}
  50%{opacity:.4;transform:scale(1.5)}
}

/* controles */
#csf-controls { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; }
#csf-tabs { display: flex; gap: 2px; background: #f1f5f9; border-radius: 8px; padding: 3px; margin-bottom: 10px; }
.csf-tab {
  flex: 1; text-align: center; padding: 5px 0;
  border-radius: 6px; font-size: 11px; font-weight: 500;
  cursor: pointer; color: #64748b;
  border: none; background: none; transition: all .15s;
}
.csf-tab.csf-on { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
#csf-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.csf-chip {
  padding: 3px 9px; border-radius: 14px; font-size: 10px; font-weight: 600;
  cursor: pointer; border: 1px solid #e2e8f0; background: #f8fafc; color: #94a3b8;
  transition: all .15s;
}
.csf-chip.csf-cd.csf-on { border-color: #dc2626; color: #dc2626; background: #fef2f2; }
.csf-chip.csf-cw.csf-on { border-color: #d97706; color: #d97706; background: #fffbeb; }
.csf-chip.csf-cs.csf-on { border-color: #16a34a; color: #16a34a; background: #f0fdf4; }

/* sección label */
#csf-sec {
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: #94a3b8;
  padding: 10px 16px 6px; border-bottom: 1px solid #f1f5f9;
}

/* lista de eventos */
#csf-list { flex: 1; overflow-y: auto; }
#csf-list::-webkit-scrollbar { width: 3px; }
#csf-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
.csf-ev {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 16px; border-bottom: 1px solid #f8fafc;
  cursor: pointer; transition: background .12s;
}
.csf-ev:hover { background: #f8fafc; }
.csf-ev.csf-hi { background: #f0fdf4; border-left: 2px solid #059669; }
.csf-evdot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 4px; flex-shrink: 0;
}
.csf-evdot.d { background: #dc2626; }
.csf-evdot.w { background: #d97706; }
.csf-evdot.s { background: #16a34a; }
.csf-evinfo { flex: 1; min-width: 0; }
.csf-evtype { font-size: 12px; font-weight: 700; color: #0f172a; margin-bottom: 1px; }
.csf-evzone { font-size: 10px; color: #64748b; }
.csf-evsrc  { font-size: 10px; color: #059669; margin-top: 1px; }
.csf-evtime { font-size: 10px; color: #94a3b8; flex-shrink: 0; margin-top: 2px; }

/* estadísticas */
#csf-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid #f1f5f9; padding: 12px 16px; gap: 4px; flex-shrink: 0;
}
.csf-stat { text-align: center; }
.csf-sn { font-size: 18px; font-weight: 800; line-height: 1; margin-bottom: 2px; }
.csf-sd { color: #dc2626; }
.csf-sw { color: #d97706; }
.csf-ss { color: #16a34a; }
.csf-sl { font-size: 9px; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; }

/* ── MAPA ── */
#csf-mapwrap { position: relative; }
#csf-map { width: 100%; height: 100%; }

#csf-upd {
  position: absolute; top: 10px; right: 12px;
  background: rgba(255,255,255,.92); border: 1px solid #e2e8f0;
  border-radius: 6px; padding: 4px 10px;
  font-size: 10px; color: #64748b; z-index: 10;
  backdrop-filter: blur(4px);
}
#csf-legend {
  position: absolute; bottom: 20px; right: 12px;
  background: rgba(255,255,255,.95); border: 1px solid #e2e8f0;
  border-radius: 9px; padding: 10px 14px; z-index: 10;
  backdrop-filter: blur(4px);
}
.csf-lt { font-size: 9px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #94a3b8; margin-bottom: 7px; }
.csf-lr { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #374151; margin-bottom: 4px; }
.csf-lc { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* responsive */
@media (max-width: 680px) {
  #csf-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: 52vw auto;  /* mapa proporcional al ancho */
    height: auto;
    border-radius: 0;
  }
  #csf-sidebar { height: 360px; order: 2; }
  #csf-mapwrap { order: 1; min-height: 52vw; }
  #csf-map     { min-height: 52vw; }
  /* Botones más pequeños en mobile */
  #csf-lang-btn, #csf-fit-btn { font-size: 10px; padding: 4px 9px; }
  #csf-fit-btn  { left: 58px; }
}

/* ── Botón de bandera / idioma ── */
#csf-lang-btn {
  position: absolute;
  top: 10px; left: 14px;
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.95);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; color: #374151;
  z-index: 10;
  transition: background .15s, box-shadow .15s;
  backdrop-filter: blur(4px);
}
#csf-lang-btn:hover {
  background: #f1f5f9;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
#csf-lang-flag { font-size: 16px; line-height: 1; }

/* ── Pulse animation on markers ── */
@keyframes csf-pulse-ring {
  0%   { transform: scale(0.6); opacity: 0.8; }
  70%  { transform: scale(2.0); opacity: 0; }
  100% { transform: scale(2.0); opacity: 0; }
}
.csf-marker-wrap {
  position: relative;
  display: inline-block;
}
.csf-pulse-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 100%; height: 100%;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  animation: csf-pulse-ring 2s ease-out infinite;
  pointer-events: none;
}

/* ── Botón Fit All ── */
#csf-fit-btn {
  position: absolute;
  top: 10px; left: 70px;
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.95);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; color: #0d9488;
  z-index: 10;
  transition: background .15s, box-shadow .15s;
  backdrop-filter: blur(4px);
  font-family: var(--ui, 'DM Sans', sans-serif);
}
#csf-fit-btn:hover {
  background: #f0fdfa;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
