©️ SASEPAMx Derechos Reservados Prohibida su copia total o parcial sin autorización expresa

:root {
    --green-alert: #00ff00;
    --red-alert: #ff0000;
    --blue-alert: #0055ff;
    --dark-bg: #000000;
    --glass-bg: rgba(0, 0, 0, 0.85);
    --glass-border: rgba(255, 255, 255, 0.15);
}

body, html { 
    margin: 0;
    padding: 0;
    height: 100%; 
    background: var(--dark-bg); 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    overflow: hidden; 
    user-select: none; 
}

#app-content {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

#mapa-ultimo-evento { 
    position: absolute; 
    top: 0; 
    left: 0;
    right: 0;
    bottom: 0; 
    width: 100%; 
    height: 100%;
    z-index: 1; 
}

.top-bar { 
    position: absolute;
    top: 0;
    width: 100%; 
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    color: #00E4E8; 
    padding: 12px 20px;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    font-size: 11px;
    z-index: 1000; 
    box-sizing: border-box;
    transition: all 0.4s ease;
}

.btn-ctrl {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-ctrl:hover {
    background: #222;
    border-color: var(--green-alert);
}

.btn-icono {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-icono:hover {
    background: #111;
    border-color: #00d4ff;
    color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.btn-icono.activo {
    background: #51f073 !important;
    color: rgb(4, 255, 4) !important;
    box-shadow: 0 0 10px #b0ff56;
}

.mapboxgl-ctrl-top-left {
    top: 60px !important; 
    left: 4px !important;  
    transition: top 0.4s ease;
}

.mapboxgl-ctrl-group {
    background: #000000 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.mapboxgl-ctrl-fullscreen span {
    filter: invert(1);
}

.mapboxgl-canvas {
    width: 100% !important;
    height: 100% !important;
}

.mapboxgl-user-location-dot {
    background-image: url('../img/ubicacion.png') !important; 
    background-size: contain !important;
    background-repeat: no-repeat !important;
    width: 10px !important; 
    height: 10px !important;
    background-color: transparent !important; 
    border: none !important;
    box-shadow: none !important; 
}

.mapboxgl-user-location-dot::before, 
.mapboxgl-user-location-dot::after {
    display: none !important;
}

#alert-container {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 380px; 
    max-width: calc(100vw - 40px); 
    z-index: 5000;
    display: none;
    transition: all 0.4s ease;
}

.banner-sismo {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border); 
    border-radius: 12px; 
    color: white; 
    padding: 16px 20px 14px 20px;
    height: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

/* 🎯 Ajustamos la fecha para que respete su espacio sin estorbar el título ni el botón de cerrar */
#alert-fecha {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Segoe UI', sans-serif;
    margin-bottom: 6px;
    display: block;
}

#alert-zone {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 800;
    margin: 0 0 2px 0;
}

#alert-title {
    font-size: 22px !important; 
    margin: 0 0 8px 0 !important;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

#logo-sasepa-alerta {
    position: absolute;
    top: 11px;    
    right: 15px;
    width: 30px;
    opacity: 0.6;
    filter: brightness(1.2);
}

.deteccion-contenedor {
    margin-top: 0;
    width: calc(100% - 40px); 
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-grid-horizontal {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem; 
}

.info-grid-horizontal p {
    margin: 0;
    white-space: nowrap; 
}

.label-mini { 
    font-size: 9px;
    text-transform: uppercase; 
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700; 
    letter-spacing: 0.5px;
    margin-bottom: 0 !important;
    display: inline-block !important;
}

.info-grid-horizontal p span {
    font-size: 18px; 
    font-weight: 900;
    margin-top: 0;
}

.btn-cerrar {
    position: absolute;
    top: 22px;            
    right: 20px;          
    width: 24px !important;  
    height: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #ff0000 !important;
    border: none !important;
    border-radius: 6px;   
    font-size: 16px !important; 
    font-weight: 900 !important; 
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
}

.btn-cerrar:hover {
    background: #ffffff !important;
    transform: scale(1.15) rotate(90deg); 
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

.btn-cerrar * {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.btn-cerrar::before {
    content: "✕" !important; 
    display: block !important;
    line-height: 1 !important;
    visibility: visible !important;
}

#alert-percepcion {
    margin-top: 12px;
    font-size: 11px;
    color: #eee;
    background: rgba(255, 255, 255, 0.07);
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.fuerte-glow {
    animation: glow-red 1.2s infinite alternate;
    background: linear-gradient(180deg, #ff0000 0%, #440000 100%) !important;
}

.moderado-glow {
    animation: glow-blue 1.2s infinite alternate;
    background: linear-gradient(180deg, #03017c 0%, #1a1c77 100%) !important;
}

@keyframes glow-red {
    from { box-shadow: 0 0 15px #ff0000; border-color: #ff0000; }
    to { box-shadow: 0 0 35px #ff0000, inset 0 0 20px #ff0000; border-color: #ffffff; }
}

@keyframes glow-blue {
    from { box-shadow: 0 0 15px #0055ff; border-color: #0055ff; }
    to { box-shadow: 0 0 35px #0055ff, inset 0 0 20px #0055ff; border-color: #ffffff; }
}

.fuerte-glow #alert-eta, 
.fuerte-glow #alert-mag { 
    color: #ffffff !important; 
}

.moderado-glow #alert-eta { 
    color: #ffff00 !important; 
}

#panel-historial {
    position: absolute; 
    top: 75px;
    left: 20px;
    transform: translateX(-120%);
    width: 350px; 
    max-width: calc(100vw - 40px);
    height: calc(100% - 170px);
    max-height: 750px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px); 
    border: 1px solid var(--glass-border); 
    border-left: 6px solid var(--green-alert);
    color: white; 
    z-index: 4000; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    padding: 20px; 
    overflow-y: auto; 
    border-radius: 0 15px 15px 0;
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

#panel-historial.active { 
    transform: translateX(0);
    pointer-events: auto; 
}

.close-historial {
    float: right;
    cursor: pointer;
    color: #ff5555;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid #ff5555;
    padding: 2px 6px;
    border-radius: 4px;
}

#lista-historial-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.historial-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 5px solid #555;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.historial-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.hist-fuerte { border-left-color: var(--red-alert) !important; box-shadow: inset 5px 0 15px rgba(255, 0, 0, 0.1); }
.hist-mod { border-left-color: #ffff00 !important; box-shadow: inset 5px 0 15px rgba(255, 255, 0, 0.05); }
.hist-ligero { border-left-color: var(--blue-alert) !important; }

.historial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.historial-fecha {
    font-size: 10px;
    color: #aaa;
    font-family: 'Courier New', monospace;
}

.historial-tag {
    font-size: 9px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.historial-zona {
    display: block;
    font-size: 14px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.historial-footer {
    margin-top: 8px;
    font-size: 9px;
    color: #666;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 5px;
}

.leyenda {
    position: absolute;
    bottom: 80px;
    left: 20px;
    padding: 12px 16px;
    border-radius: 10px;
    background: transparent;
    border: none;
    backdrop-filter: none;
    color: #b5b8b4;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    z-index: 1000;
    width: 320px; 
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 6px 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    box-sizing: border-box;
    box-shadow: none;
}

.leyenda-titulo { 
    grid-column: span 2; 
    font-size: 10px; 
    font-weight: 900; 
    color: #00d4ff; 
    text-align: center; 
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    padding-bottom: 4px; 
    text-transform: uppercase;
    letter-spacing: 1px;
}

.separador-leyenda { 
    grid-column: span 2; 
    height: 1px; 
    background: rgba(255,255,255,0.1); 
    margin: 2px 0; 
}

.leyenda-item { 
    display: flex; 
    align-items: center; 
}

.leyenda-item span { 
    font-size: 8px; 
    text-transform: uppercase; 
    font-weight: 700;
    color: #eee;
}

.difusion-simb { 
    width: 11px; 
    height: 11px; 
    border-radius: 50%; 
    background: transparent; 
    margin-right: 6px; 
    box-sizing: border-box;
}
.d-fuerte   { border: 2px solid #ff0000; box-shadow: 0 0 5px rgba(255,0,0,0.4); }
.d-moderado { border: 2px solid #73ff00; box-shadow: 0 0 5px rgba(155, 234, 8, 0.4); }
.d-impercep { border: 2px solid #09ff00; }
.ciudad-dot { 
    width: 8px; 
    height: 8px; 
    border-radius: 50%; 
    margin-right: 6px; 
}
.c-fuerte   { background: #ff0000; box-shadow: 0 0 5px #ff0000; }
.c-amarillo { background: #fffb00; box-shadow: 0 0 5px #fffb00; }
.c-verde    { background: #47ff5f; box-shadow: 0 0 5px #47ff5f; }

.onda-p-simb { 
    width: 11px; 
    height: 11px; 
    border: 1.5px solid #ffffff; 
    background: rgba(255,255,255,0.1); 
    border-radius: 50%; 
    margin-right: 6px; 
}
.onda-s-simb { 
    width: 11px; 
    height: 11px; 
    border-radius: 50%; 
    margin-right: 6px; 
    box-sizing: border-box;
}
.onda-s   { background: rgba(160, 247, 0, 0.25); border: 1.5px solid #73ff00; }

.historial-simb { 
    width: 10px; 
    height: 10px; 
    border-radius: 50%; 
    background: transparent; 
    border: 1.5px solid #192a8b; 
    margin-right: 6px; 
    animation: blink 1.5s infinite; 
}

.icon-ubi { 
    width: 11px; 
    height: 11px; 
    margin-right: 6px; 
    object-fit: contain;
}

.estado-sistema-leyenda {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-top: 6px;
    margin-top: 2px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 10px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 1px;
}

.estado-sistema-leyenda i {
    color: #00ff00;
    font-size: 10px;
}

@keyframes blink { 
    0%, 100% { opacity: 1; } 
    50% { opacity: 0.3; } 
}

.leyenda.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-20px);
    pointer-events: none;
}

#cuadro-ciudades { 
    position: absolute;
    bottom: 120px;  
    right: 20px; 
    left: auto !important; 
    width: 250px;  
    z-index: 4000;
    transition: all 0.4s ease;
}

#cuadro-ciudades.leyenda-oculta {
    right: auto !important;
    left: 20px !important;
    bottom: 70px !important;
    width: 250px !important;
}

.cerrar-leyenda {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    transition: 0.2s;
}

.cerrar-leyenda:hover {
    color: #ff0000;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 12px;
    display: inline-block;
}

.dot.online {
    background: var(--green-alert);
    box-shadow: 0 0 10px var(--green-alert);
}

.dot.fuerte { background: var(--red-alert); } 
.dot.moderado { background: #ffff00; }             
.dot.ligero { background: var(--blue-alert); }

.dot.onda-p {
    background: transparent;
    border: 2px solid #facc15;
}

.dot.onda-s {
    background: rgba(255, 0, 0, 0.3);
    border: 1.5px solid #ff0000;
}

#btn-status {
    color: #00ff00; 
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: #0a0a0a;
    border-top: 5px solid var(--green-alert);
    padding: 24px;
    width: 100%;
    max-width: 460px; 
    max-height: 85vh; 
    border-radius: 16px;
    text-align: center;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column; 
    box-sizing: border-box;
}

.modal-content h2 {
    font-size: 16px;
    font-weight: 900;
    margin: 0 0 16px 0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.modal-body {
    flex: 1;
    overflow-y: auto; 
    text-align: left;
    padding-right: 8px;
    margin-bottom: 20px;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--green-alert);
}

.modal-body p {
    font-size: 11.5px; 
    line-height: 1.5;
    color: #ccc;
    margin: 0 0 14px 0;
}

.modal-body p strong {
    color: #fff;
    font-weight: 700;
}

.btn-aceptar {
    background: transparent;
    border: 1px solid #ffffff;
    color: #ffffff;
    padding: 10px 24px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.btn-aceptar:hover {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

@media (max-height: 700px) {
    .modal-content {
        padding: 16px;
        max-height: 90vh;
    }
    .modal-content h2 {
        margin-bottom: 12px;
        font-size: 14px;
    }
    .modal-body p {
        font-size: 11px;
        margin-bottom: 10px;
    }
    .btn-aceptar {
        padding: 8px 20px;
    }
}

#btn-toggle-ui {
    position: fixed;
    bottom: 95px; 
    right: 20px;
    z-index: 10000;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    color: #3b82f6;
    border: 2px solid #3b82f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

#btn-toggle-ui:hover {
    background: #3b82f6;
    color: white;
}

#reloj {
    position: fixed;
    bottom: 15px;
    right: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border-right: 4px solid #3a69ec;
    padding: 10px 15px;
    border-radius: 6px;
    z-index: 9999;
    font-family: 'Courier New', monospace;
    text-align: right;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    pointer-events: none; 
    transition: all 0.4s ease;
}

#hora-cdmx {
    color: #00E4E8;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 1px;
}

#fecha-cdmx {
    color: #ffffff;
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.9;
}

.tag-sasepa {
    color: #4ade80; 
    font-size: 9px;
    font-weight: bold;
    margin-top: 4px;
    text-transform: uppercase;
}

.contenedor-controles-manuales {
    position: absolute;
    bottom: 15px;
    left: 67%;
    transform: translateX(-50%) translateY(0);
    display: flex;
    flex-direction: row;
    gap: 8px; 
    z-index: 1000;
    padding: 6px 12px; 
    border-radius: 8px; 
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.ui-hidden-bottom {
    transform: translateX(-50%) translateY(150%) !important;
    opacity: 0;
    pointer-events: none;
}

.contenedor-controles-manuales button, 
.contenedor-controles-manuales .btn-icono {
    padding: 6px 12px; 
    font-size: 11px; 
    border-radius: 6px; 
}

.map-style-selector {
    display: flex;
    gap: 5px;
}

.map-style-selector button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-style-selector button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00d4ff;
}

.logos-sasepa-fondo {
    position: fixed;
    bottom: 85px;         
    left: 50%;
    transform: translateX(-50%);
    width: auto;                  
    display: flex;
    justify-content: center; 
    align-items: center;
    z-index: 5;
    pointer-events: none;
    user-select: none;
    transition: all 0.4s ease;
}

.logos-sasepa-fondo img {
    height: 120px;         
    width: auto;
    opacity: 0.12;    
    filter: drop-shadow(0px 0px 5px rgba(0,0,0,0.5));
    transition: all 0.4s ease;
}

.dot.sismo-ligero {
    width: 12px;
    height: 12px;
    background-color: #007cff;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid #fff;
    box-shadow: 0 0 8px #007cff;
    position: relative;
}

.dot.sismo-ligero::after {
    content: "";
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #007cff;
    border-radius: 50%;
    animation: pulse 2s infinite;
    opacity: 0;
}

.dot.sismo-fuerte {
    width: 12px;
    height: 12px;
    background-color: #ff0000;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid #fff;
    box-shadow: 0 0 8px #ff0800;
    position: relative;
}

.dot.sismo-fuerte::after {
    content: "";
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #ff5100;
    border-radius: 50%;
    animation: pulse 2s infinite;
    opacity: 0;
}

@keyframes pulse {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

#sensor-ticker {
    position: absolute;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    color: white;
    text-align: center;
    width: 80%;
    pointer-events: none;
}

#ticker-text {
    font-size: 1.4em;
    font-weight: bold;
    text-shadow: 2px 2px 8px #000;
    letter-spacing: 1px;
    transition: all 0.3s ease-in-out;
}

#btn-toggle-logs {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
    background: #1e1e24;
    color: #ffffff;
    border: 1px solid #4f7df0;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}
#btn-toggle-logs:hover {
    background: #4f7df0;
    box-shadow: 0 4px 15px rgba(79, 125, 240, 0.4);
}

#panel-lateral-logs {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px; 
    height: 100vh;
    background: #0d0e12;
    z-index: 4500;
    box-shadow: 5px 0 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', Courier, monospace;
    transition: transform 0.4s cubic-bezier(0.05, 0.74, 0.2, 1.0);
}

.panel-cerrado {
    transform: translateX(-100%);
}
.panel-abierto {
    transform: translateX(0);
}

.cabecera-logs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #161920;
    border-bottom: 1px solid #262c3a;
    color: #fff;
}
.cabecera-logs h3 { margin: 0; font-size: 14px; font-family: sans-serif; }
.btn-cerrar-logs {
    background: none; border: none; color: #8a90a0; font-size: 18px; cursor: pointer;
}
.btn-cerrar-logs:hover { color: #ff4f4f; }

.filtros-logs {
    display: flex;
    gap: 5px;
    padding: 8px 15px;
    background: #111318;
    border-bottom: 1px solid #1c1f27;
    align-items: center;
}
.filtro-btn {
    background: #1c1f27; color: #8a90a0; border: none; padding: 4px 10px;
    border-radius: 4px; cursor: pointer; font-size: 11px; font-family: sans-serif;
}
.filtro-btn.activo { background: #4f7df0; color: #fff; }
#btn-limpiar-logs {
    background: none; border: none; cursor: pointer; margin-left: auto; font-size: 14px;
}

#contenedor-consola-logs {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    font-size: 12px;
    line-height: 1.5;
}

.log-linea {
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #14161d;
    white-space: pre-wrap;
    animation: fadeInLog 0.2s ease-out;
}
@keyframes fadeInLog { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }

.log-todos { color: #d1d4db; }
.log-conexion { color: #4f7df0; }  
.log-online { color: #00e676; }   
.log-alerta { color: #b3acac; font-weight: bold; } 
.log-desconectado { color: #ff0000; } 

#apartado-reporte-sensores {
    background: #111318;
    padding: 15px;
    border-bottom: 1px solid #262c3a;
    font-family: sans-serif;
}

.titulo-apartado {
    color: #4f7df0;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.grid-reportes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.tarjeta-reporte {
    background: #161920;
    border: 1px solid #222735;
    border-radius: 6px;
    padding: 10px 5px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.num-reporte {
    font-size: 15px;
    font-weight: bold;
    font-family: monospace;
    color: #fff;
}

.txt-reporte {
    color: #7c8494;
    font-size: 9px; 
    margin-top: 4px;
}

#reporte-online { color: #00e676; }
#reporte-offline { color: #ff3d00; }
#reporte-pings { color: #00d4ff; }

@media (max-width: 1366px) {
    #alert-fecha {
        position: absolute;
        top: 50px;      
        right: 15px;      
        font-size: 11px;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.7);
        font-family: 'Segoe UI', sans-serif; 
        white-space: nowrap;
    }
    #alert-container { 
        top: 1px; 
        right: 1px; 
        width: 230px; 
    }
    #alert-title { font-size: 27px !important; margin-bottom: 6px !important; }
    .banner-sismo { padding: 12px 15px; }
    .leyenda {
        width: 240px;
        font-size: 10px;
        bottom: 15px;
        left: 285px;
    }
    
    #cuadro-ciudades {
        width: 180px;
        bottom: 110px;
        right: 15px;
        left: auto !important;
    }

    #cuadro-ciudades.leyenda-oculta {
        right: auto !important;
        left: 15px !important;
        bottom: 65px !important;
        width: 220px !important;
    }

    #reloj {
        bottom: 15px;
        right: 15px;
        padding: 8px 12px;
    }
    #hora-cdmx { font-size: 21px; }
    #panel-historial { width: 320px; height: calc(100% - 150px); top: 70px; }
    .logos-sasepa-fondo img { height: 90px; }
}

@media (max-width: 1024px) {
    .top-bar { padding: 8px 15px; font-size: 10px; }
    .mapboxgl-ctrl-top-left { top: 140px; }
    
    #alert-container { 
        top: 1px; 
        right: 1px; 
        width: 210px; 
    }
    #alert-title { font-size: 20px !important; margin-bottom: 6px !important; }
    .banner-sismo { padding: 12px 15px; }

    #alert-fecha {
        position: absolute;
        top: 50px;      
        right: 15px;      
        font-size: 11px;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.7);
        font-family: 'Segoe UI', sans-serif; 
        white-space: nowrap;
    }

    #sensor-ticker {
        position: absolute;
        top: 60px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        color: white;
        text-align: center;
        width: 80%;
        pointer-events: none;
    }

    .leyenda {
        grid-template-columns: 1fr; 
        width: 180px;
        bottom: 20px;
        left: 285px;
    }
    .separador-leyenda, .estado-sistema-leyenda { display: none !important; } 
    
    #reloj {
        bottom: auto;
        top: 55px;
        right: auto;
        left: 15px;
        border-right: none;
        border-left: 4px solid #00E4E8;
        background: rgba(0, 0, 0, 0.9);
    }
    
    #cuadro-ciudades {
        bottom: 50px;
        right: 15px;
        width: 200px;
    }
    #btn-toggle-ui { bottom: 20px; right: 15px; width: 40px; height: 40px; }
    .logos-sasepa-fondo { bottom: 75px; }
    .logos-sasepa-fondo img { height: 60px; opacity: 0.07; }
    .contenedor-controles-manuales { bottom: 5px; padding: 4px 8px; left: 50%; }
}

@media (max-width: 768px) {
    #alert-container { 
        top: 0; 
        right: 0;
        left: 0;  
        width: 100%; 
        max-width: 100vw; 
    }
    .banner-sismo { 
        border-radius: 0 0 15px 15px; 
        border-top: none; 
    }
    .btn-cerrar { top: 15px; right: 15px; }
    #alert-fecha { display: none; }
    .leyenda { display: none !important; } 
    #cuadro-ciudades { bottom: 15px; left: 15px; right: auto; width: calc(100% - 30px); max-width: 260px; }
    #reloj { display: none !important; }
    .logos-sasepa-fondo { display: none !important; }
    .contenedor-controles-manuales { bottom: 10px; left: 30%; }
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(0, 255, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); }
}