/* ============================================================
   RESET Y LAYOUT PRINCIPAL
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  min-height: 100vh;
}

.app-container { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* ============================================================
   HEADER
   ============================================================ */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.app-header h1 {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions { display: flex; align-items: center; gap: 16px; }

.header-actions select,
.header-actions button {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.header-actions button {
  background: #3b82f6;
  color: white;
  border: none;
  font-weight: 600;
}
.header-actions button:hover { background: #2563eb; }
.header-actions select:hover { border-color: #94a3b8; }

/* ============================================================
   SECCIONES (landing / wizard / map)
   ============================================================ */

.section { display: none; animation: fadeIn 0.4s ease; }
.section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ANIMACIONES GLOBALES (usadas por toasts de UIController)
   ============================================================ */

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateX(0);     opacity: 1; }
  to   { transform: translateX(100px); opacity: 0; }
}

/* ============================================================
   HELPERS
   ============================================================ */

.hidden { display: none !important; }
.text-center { text-align: center; }

/* ============================================================
   RESPONSIVE GLOBAL
   ============================================================ */

@media (max-width: 768px) {
  .app-header { flex-direction: column; align-items: stretch; text-align: center; }
  .header-actions { justify-content: center; flex-wrap: wrap; }
}

/* ============================================================
   ATTRIBUTION FOOTER (bajo el mapa)
   ============================================================ */

.map-attribution {
  margin-top: 16px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.55;
  color: #64748b;
}

.map-attribution-text {
  margin-bottom: 4px;
}

.map-attribution-text a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.map-attribution-text a:hover {
  text-decoration: underline;
}

.map-attribution-legal {
  font-size: 10px;
  color: #94a3b8;
  font-style: italic;
  line-height: 1.45;
}

@media print {
  .map-attribution {
    background: #fff;
    border-color: #cbd5e1;
  }
}
/* ============================================================
   Overlay "Calculando Jenks" — solo se muestra para datasets grandes
   ============================================================ */

body.jenks-loading::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(2px);
  z-index: 9998;
  pointer-events: none;
  animation: jenksFadeIn 0.2s ease-out;
}

body.jenks-loading::after {
  content: '⏳ Calculando Rupturas Naturales…';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 16px 28px;
  background: #1e293b;
  color: #fff;
  border-radius: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  z-index: 9999;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  animation: jenksFadeIn 0.2s ease-out;
}

@keyframes jenksFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.app-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;              /* espacio entre icono y texto */
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.app-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;     /* redondeo de las esquinas del icono */
  flex-shrink: 0;         /* evita que se aplaste en pantallas pequeñas */
  display: block;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;         /* hereda el color del header */
  font-weight: 700;
  font-size: 18px;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
  display: block;
}