/* =====================================================
   SISMOS - CSS para PulsoPeru
   Archivo independiente para seccion de sismos
   ===================================================== */

:root {
    /* Paleta moderna y limpia */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Colores de acento suaves */
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dark: #4f46e5;
    --accent-bg: #eef2ff;

    /* Colores de magnitud */
    --verde: #10b981;
    --verde-light: #d1fae5;
    --amarillo: #f59e0b;
    --amarillo-light: #fef3c7;
    --naranja: #f97316;
    --naranja-light: #ffedd5;
    --rojo: #ef4444;
    --rojo-light: #fee2e2;

    /* Sombras suaves */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
    --shadow-hover: 0 12px 32px rgba(0,0,0,0.08);

    /* Bordes */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* =====================================================
   HEADER
   ===================================================== */
.site-header {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    text-decoration: none;
}

.logo h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo h1 span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--accent);
    background: var(--accent-bg);
}

.nav-links a.active {
    color: var(--accent);
    background: var(--accent-bg);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-primary);
}

/* =====================================================
   ALERTA ULTIMO SISMO
   ===================================================== */
.ultimo-sismo-alert {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 24px 0;
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
}

.ultimo-sismo-alert.severo {
    background: linear-gradient(135deg, #dc2626 0%, #f87171 100%);
    animation: pulse-alert 2s infinite;
}

.ultimo-sismo-alert.importante {
    background: linear-gradient(135deg, #ea580c 0%, #fb923c 100%);
}

.ultimo-sismo-alert.moderado {
    background: linear-gradient(135deg, #ca8a04 0%, #facc15 100%);
    color: #1e293b;
}

@keyframes pulse-alert {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(220, 38, 38, 0); }
}

.alerta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.alerta-badge {
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.alerta-tiempo {
    font-size: 12px;
    opacity: 0.8;
}

.alerta-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
}

.alerta-magnitud {
    text-align: center;
}

.mag-numero {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.mag-label {
    font-size: 11px;
    opacity: 0.8;
    text-transform: uppercase;
}

.alerta-info h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.alerta-info p {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.alerta-acciones {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-ver-mapa {
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-ver-mapa:hover {
    background: rgba(255,255,255,0.3);
}

/* =====================================================
   PAGE TITLE
   ===================================================== */
.page-title {
    text-align: center;
    padding: 20px 0;
}

.page-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-title h2 i {
    color: var(--accent);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.update-time {
    font-size: 12px;
    color: var(--verde);
    margin-top: 8px;
}

.update-time::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--verde);
    border-radius: 50%;
    margin-right: 6px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* =====================================================
   SELECTOR DE PAISES
   ===================================================== */
.paises-selector {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.paises-selector h3 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 18px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.paises-selector h3 i {
    margin-right: 8px;
    color: var(--accent);
}

.paises-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.pais-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 2px solid transparent;
    min-width: 110px;
    position: relative;
    overflow: hidden;
}

.pais-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.25s;
}

.pais-card:hover {
    background: #f1f5f9;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.pais-card:hover::before {
    background: var(--accent-light);
}

.pais-card.active {
    background: white;
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15);
}

.pais-card.active::before {
    background: var(--accent);
}

.pais-bandera {
    font-size: 40px;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.25s;
}

.pais-card:hover .pais-bandera {
    transform: scale(1.1);
}

.pais-card.active .pais-bandera {
    transform: scale(1.15);
}

.pais-nombre {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.pais-sismos {
    font-size: 11px;
    color: var(--text-secondary);
    background: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pais-card.active .pais-nombre {
    color: var(--accent);
}

.pais-card.active .pais-sismos {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

/* =====================================================
   FILTROS MEJORADOS
   ===================================================== */
.filtros-mejorados {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.filtro-magnitud-visual,
.filtro-tiempo {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.filtro-magnitud-visual label,
.filtro-tiempo label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.filtro-magnitud-visual label i,
.filtro-tiempo label i {
    margin-right: 8px;
    color: var(--accent);
}

.magnitud-slider {
    position: relative;
}

.magnitud-slider input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: linear-gradient(90deg, var(--verde) 0%, var(--amarillo) 50%, var(--rojo) 100%);
    border-radius: 4px;
    outline: none;
}

.magnitud-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border: 3px solid var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.magnitud-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.magnitud-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 10px;
    color: var(--text-secondary);
}

.magnitud-valor {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.tiempo-btns {
    display: flex;
    gap: 8px;
}

.tiempo-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tiempo-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tiempo-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* =====================================================
   GRAFICO DE ACTIVIDAD - Estilo Google
   ===================================================== */
.actividad-chart {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.chart-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-title h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chart-pais-select {
    position: relative;
}

.chart-pais-select select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--accent-bg);
    color: var(--accent);
    padding: 6px 32px 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.chart-pais-select select:hover {
    border-color: var(--accent);
}

.chart-pais-select select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chart-pais-select::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--accent);
    pointer-events: none;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chart-periodo-btns {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 3px;
}

.periodo-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.periodo-btn:hover {
    color: var(--text-primary);
}

.periodo-btn.active {
    background: white;
    color: var(--accent);
    box-shadow: var(--shadow-xs);
}

.chart-total {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--accent-bg);
    padding: 6px 12px;
    border-radius: 8px;
}

.chart-container {
    position: relative;
    height: 150px;
    margin: 0 -8px;
}

.chart-container canvas {
    width: 100%;
    height: 100%;
}

.chart-tooltip {
    position: absolute;
    background: white;
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    width: 220px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border: 1px solid var(--border-light);
}

.chart-tooltip.visible {
    opacity: 1;
}

.chart-tooltip .tooltip-header {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.chart-tooltip .tooltip-count {
    font-size: 11px;
    color: var(--text-secondary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 8px;
}

.chart-tooltip .tooltip-lugares {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chart-tooltip .tooltip-lugar {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.chart-tooltip .tooltip-mag {
    display: inline-block;
    background: var(--accent-bg);
    color: var(--accent);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 4px;
}

.chart-tooltip .tooltip-mas {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 11px;
    color: var(--text-muted);
}

.chart-labels span {
    text-align: center;
    line-height: 1.3;
}

.chart-labels span small {
    display: block;
    font-size: 9px;
    color: var(--text-muted);
    opacity: 0.7;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-item .dot.verde { background: #10b981; }
.legend-item .dot.amarillo { background: #f59e0b; }
.legend-item .dot.naranja { background: #f97316; }
.legend-item .dot.rojo { background: #ef4444; }

/* =====================================================
   FILTROS
   ===================================================== */
.filtros-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 15px 0;
    margin-bottom: 20px;
}

.filtro-grupo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filtro-grupo label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filtro-btns {
    display: flex;
    gap: 5px;
}

.filtro-btn {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filtro-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filtro-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* =====================================================
   LAYOUT PRINCIPAL
   ===================================================== */
.sismos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    margin-bottom: 30px;
}

/* =====================================================
   MAPA
   ===================================================== */
.mapa-container {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.mapa {
    height: 500px;
    width: 100%;
}

.mapa-leyenda {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 12px;
    background: #f8fafc;
    font-size: 11px;
    color: var(--text-secondary);
}

.leyenda-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

.leyenda-dot.severo { background: var(--rojo); }
.leyenda-dot.importante { background: var(--naranja); }
.leyenda-dot.moderado { background: var(--amarillo); }
.leyenda-dot.leve { background: var(--verde); }

/* =====================================================
   LISTA DE SISMOS
   ===================================================== */
.lista-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    max-height: 560px;
}

.lista-titulo {
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-primary);
}

.lista-titulo i {
    color: var(--accent);
    margin-right: 8px;
}

.sismos-lista {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.sismo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.sismo-item:hover {
    background: #f8fafc;
}

.sismo-item.active {
    background: var(--accent-bg);
    border: 1px solid #c7d2fe;
}

.sismo-mag {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sismo-mag.severo { background: var(--rojo); }
.sismo-mag.importante { background: var(--naranja); }
.sismo-mag.moderado { background: var(--amarillo); color: #1a1a2e; }
.sismo-mag.leve { background: var(--verde); }

.sismo-info {
    flex: 1;
    min-width: 0;
}

.sismo-lugar {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sismo-tags {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.pais-tag {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

.region-tag {
    background: var(--accent-bg);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    color: var(--accent);
    font-weight: 500;
}

.sismo-detalles {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.sismo-fecha {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

.sismo-fecha span {
    display: block;
}

/* =====================================================
   ESTADISTICAS
   ===================================================== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card i {
    font-size: 24px;
    color: var(--accent);
    margin-bottom: 10px;
}

.stat-numero {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* =====================================================
   INFO Y EMERGENCIAS
   ===================================================== */
.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.info-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.info-card h3 i {
    color: var(--accent);
    margin-right: 8px;
}

.emergencias-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.emergencia-item {
    background: var(--accent-bg);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.emergencia-num {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}

.emergencia-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.recomendaciones-lista {
    list-style: none;
}

.recomendaciones-lista li {
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid #f1f5f9;
}

.recomendaciones-lista li:last-child {
    border-bottom: none;
}

.recomendaciones-lista li i {
    color: var(--verde);
    margin-right: 10px;
}

/* =====================================================
   TELEGRAM CTA
   ===================================================== */
.telegram-cta {
    background: linear-gradient(135deg, #0088cc 0%, #00a0dc 100%);
    border-radius: var(--radius);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
    margin-bottom: 30px;
}

.telegram-icon {
    font-size: 40px;
    opacity: 0.9;
}

.telegram-text {
    flex: 1;
}

.telegram-text h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.telegram-text p {
    font-size: 13px;
    opacity: 0.9;
}

.telegram-btn {
    background: white;
    color: #0088cc;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s;
}

.telegram-btn:hover {
    transform: scale(1.05);
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 30px 0;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-light);
}

.footer-copy {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

/* =====================================================
   LOADING
   ===================================================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    width: 30px;
    height: 30px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================
   CURIOSIDADES
   ===================================================== */
.curiosidades-section {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.curiosidades-section h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.curiosidades-section h3 i {
    color: #eab308;
    margin-right: 8px;
}

.curiosidades-slider {
    position: relative;
    min-height: 80px;
}

.curiosidad-card {
    display: none;
    animation: fadeIn 0.5s ease;
}

.curiosidad-card.active {
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.curiosidad-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent);
    flex-shrink: 0;
}

.curiosidad-card p {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
}

.curiosidad-card strong {
    color: var(--accent);
}

.curiosidad-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.curiosidad-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s;
}

.curiosidad-dot.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
}

/* =====================================================
   SISMOS HISTORICOS
   ===================================================== */
.historicos-section {
    margin-bottom: 30px;
}

.historicos-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.historicos-section h3 i {
    color: var(--accent);
    margin-right: 8px;
}

.historicos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.historico-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.historico-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.historico-mag {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--rojo) 0%, #991b1b 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.historico-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.historico-info p {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* =====================================================
   BARRA EN VIVO
   ===================================================== */
.live-bar {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    border-radius: var(--radius);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    color: white;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
}

.live-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.live-stats {
    display: flex;
    gap: 25px;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

.live-stats i {
    margin-right: 5px;
}

.btn-notificar {
    background: var(--accent);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-notificar:hover {
    background: var(--accent-dark);
    transform: scale(1.05);
}

.btn-notificar.active {
    background: var(--verde);
}

.btn-notificar i {
    animation: ring 2s infinite;
}

@keyframes ring {
    0%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(15deg); }
    20%, 40% { transform: rotate(-15deg); }
    50% { transform: rotate(0); }
}

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #e2e8f0;
}

.modal-header {
    background: linear-gradient(135deg, var(--rojo) 0%, #991b1b 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.modal-header .mag-big {
    font-size: 64px;
    font-weight: 700;
}

.modal-header h2 {
    font-size: 24px;
    margin-top: 10px;
}

.modal-header p {
    opacity: 0.9;
    margin-top: 5px;
}

.modal-body {
    padding: 25px;
}

.modal-body p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.modal-stat {
    text-align: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
}

.modal-stat .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.modal-stat .label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* =====================================================
   ANIMACION SISMO NUEVO
   ===================================================== */
.sismo-nuevo {
    animation: nuevoSismo 1s ease;
}

@keyframes nuevoSismo {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.02); background: var(--accent-bg); }
    50% { transform: scale(1); }
    75% { transform: scale(1.02); background: var(--accent-bg); }
}

.alerta-nueva {
    animation: alertaNueva 0.5s ease;
}

@keyframes alertaNueva {
    0% { transform: scale(0.95); opacity: 0; }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 1; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 992px) {
    .sismos-layout {
        grid-template-columns: 1fr;
    }

    .lista-container {
        max-height: 400px;
    }

    .mapa {
        height: 400px;
    }

    .chart-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .chart-controls {
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }

    .alerta-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .alerta-magnitud {
        margin-bottom: 10px;
    }

    .mag-numero {
        font-size: 42px;
    }

    .alerta-acciones {
        flex-direction: row;
        justify-content: center;
        margin-top: 15px;
    }

    .stats-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 15px 10px;
    }

    .stat-numero {
        font-size: 24px;
    }

    .stat-label {
        font-size: 10px;
    }

    .info-section {
        grid-template-columns: 1fr;
    }

    .telegram-cta {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .telegram-icon {
        font-size: 32px;
    }

    .filtros-container {
        flex-direction: column;
        align-items: center;
    }

    .chart-header {
        flex-direction: column;
        gap: 12px;
    }

    .chart-title {
        justify-content: center;
        flex-wrap: wrap;
    }

    .chart-controls {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .chart-periodo-btns {
        width: 100%;
        justify-content: center;
    }

    .periodo-btn {
        flex: 1;
        text-align: center;
    }

    .historicos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .live-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }

    .live-stats {
        flex-direction: row;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .curiosidad-card.active {
        flex-direction: column;
        text-align: center;
    }

    .paises-selector {
        padding: 15px;
    }

    .paises-grid {
        gap: 8px;
    }

    .pais-card {
        padding: 12px 10px;
        min-width: 60px;
    }

    .pais-bandera {
        font-size: 26px;
        margin-bottom: 5px;
    }

    .pais-nombre {
        font-size: 10px;
    }

    .pais-sismos {
        font-size: 8px;
        padding: 2px 5px;
    }

    .filtros-mejorados {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .magnitud-valor {
        top: -25px;
        padding: 3px 10px;
        font-size: 11px;
    }

    .tiempo-btns {
        flex-wrap: wrap;
    }

    .tiempo-btn {
        flex: 1 1 45%;
    }

    .ultimo-sismo-alert {
        padding: 18px;
        margin: 15px 0;
    }

    .page-title h2 {
        font-size: 18px;
    }

    .sismo-item {
        padding: 10px;
        gap: 10px;
    }

    .sismo-mag {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }

    .sismo-lugar {
        font-size: 12px;
    }

    .sismo-fecha {
        font-size: 10px;
    }
}

@media (max-width: 500px) {
    .container {
        padding: 0 10px;
    }

    .mapa {
        height: 280px;
    }

    .mapa-leyenda {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 10px;
        padding: 10px;
    }

    .filtro-btns {
        flex-wrap: wrap;
        justify-content: center;
    }

    .emergencias-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .emergencia-item {
        padding: 12px 8px;
    }

    .emergencia-num {
        font-size: 22px;
    }

    .historicos-grid {
        grid-template-columns: 1fr;
    }

    .historico-card {
        padding: 15px;
    }

    .modal-stats {
        grid-template-columns: 1fr;
    }

    .stats-container {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px 8px;
    }

    .stat-card i {
        font-size: 18px;
        margin-bottom: 5px;
    }

    .stat-numero {
        font-size: 20px;
    }

    .paises-selector h3 {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .pais-card {
        padding: 10px 8px;
        min-width: 55px;
    }

    .pais-bandera {
        font-size: 22px;
    }

    .pais-nombre {
        font-size: 9px;
    }

    .chart-container {
        height: 120px;
    }

    .actividad-chart {
        padding: 15px;
    }

    .chart-title h4 {
        font-size: 14px;
    }

    .alerta-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .alerta-info h3 {
        font-size: 14px;
    }

    .alerta-info p {
        font-size: 12px;
    }

    .btn-ver-mapa {
        padding: 8px 12px;
        font-size: 11px;
    }

    .lista-titulo {
        padding: 12px 15px;
        font-size: 13px;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }

    .telegram-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .paises-grid {
        gap: 5px;
    }

    .pais-card {
        padding: 8px 6px;
        min-width: 50px;
    }

    .pais-bandera {
        font-size: 20px;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .stat-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        padding: 12px 15px;
    }

    .stat-card i {
        margin-bottom: 0;
        margin-right: 10px;
    }

    .mag-numero {
        font-size: 36px;
    }
}
