:root {
    --neon-green: #e9e9e9; --neon-red: #ff3131; --neon-blue: #00d4ff;
    --bg-dark: #050505; --panel-bg: rgba(10, 15, 20, 0.95);
}
body { margin: 0; background: var(--bg-dark); color: var(--neon-green); font-family: 'Share Tech Mono', monospace; overflow: hidden; }
#container { display: flex; width: 100vw; height: 100vh; }
#canvas-container { 
    flex: 1; /* Esto le dice: ocupa todo el espacio que el sidebar no use */
    position: relative; 
    overflow: hidden;
}

#sidebar { 
    width: 420px; 
    flex-shrink: 0; /* EVITA que el mapa lo comprima a 0 */
    background: var(--panel-bg); 
    border-left: 2px solid #1a1a1a; 
    display: flex; 
    flex-direction: column; 
    padding: 20px; 
    box-sizing: border-box; 
    z-index: 100;
    overflow-y: auto;
    transition: all 0.3s ease; /* Transición suave */
    visibility: visible;
    opacity: 1;
}

.location-setup {
    background: rgba(0, 212, 255, 0.1);
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--neon-blue);
}

.location-setup input {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--neon-blue);
    color: var(--neon-green);
    padding: 5px;
    width: 80px;
    font-family: inherit;
}

.location-setup button {
    background: var(--neon-blue);
    color: black;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-family: inherit;
    margin-left: 5px;
}

#quake-list { flex-grow: 1; overflow-y: auto; margin-top: 10px; }

.quake-card { 
    background: rgba(255, 255, 255, 0.03); padding: 12px; margin-bottom: 8px; 
    border-left: 4px solid var(--neon-blue); cursor: pointer; transition: 0.2s;
    position: relative;
}
.quake-card:hover { background: rgba(0, 212, 255, 0.1); transform: translateX(-5px); }

.quake-card.mmi-0, .quake-card.mmi-N, .quake-card.mmi-I { border-left-color: #fff; }
.quake-card.mmi-II   { border-left-color: rgb(191, 204, 255); }
.quake-card.mmi-III  { border-left-color: rgb(160, 230, 255); }
.quake-card.mmi-IV   { border-left-color: rgb(128, 255, 255); }
.quake-card.mmi-V    { border-left-color: rgb(122, 255, 147); }
.quake-card.mmi-VI   { border-left-color: rgb(255, 255, 0); }
.quake-card.mmi-VII  { border-left-color: rgb(255, 200, 0); }
.quake-card.mmi-VIII { border-left-color: rgb(255, 145, 0); }
.quake-card.mmi-IX   { border-left-color: rgb(255, 0, 0); }
.quake-card.mmi-X    { border-left-color: rgb(200, 0, 0); }
.quake-card.mmi-XI   { border-left-color: rgb(164, 0, 0); }
.quake-card.mmi-XII  { border-left-color: rgb(128, 0, 0); }

.mercalli {
  margin: 0.1em 0.1em;
  padding: 0.3em .6em;
  color: #000;
  font-weight: bold;
  border-radius: 4px;
  display: inline-block;
}

.mercalli-0, .mercalli-i { background-color: #fff; }
.mercalli-ii    { background-color: rgb(191, 204, 255); }
.mercalli-iii   { background-color: rgb(160, 230, 255); }
.mercalli-iv    { background-color: rgb(128, 255, 255); }
.mercalli-v     { background-color: rgb(122, 255, 147); }
.mercalli-vi    { background-color: rgb(255, 255, 0); }
.mercalli-vii   { background-color: rgb(255, 200, 0); }
.mercalli-viii  { background-color: rgb(255, 145, 0); }
.mercalli-ix    { background-color: rgb(255, 0, 0); }
.mercalli-x     { background-color: rgb(200, 0, 0); }
.mercalli-xi    { background-color: rgb(164, 0, 0); }
.mercalli-xii   { background-color: rgb(128, 0, 0); }

.quake-flag {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
}

.quake-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 4px;
}

.quake-details {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.detail-badge {
    background: rgba(0,0,0,0.5);
    padding: 2px 6px;
    border-radius: 3px;
}

.tsunami-warning {
    background: rgba(255, 0, 0, 0.3);
    border: 1px solid red;
    padding: 3px 8px;
    margin-top: 5px;
    font-size: 0.8rem;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#emergency-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(255, 0, 0, 0.2); display: none; z-index: 9999;
    border: 20px solid red; pointer-events: none; animation: blink 0.5s infinite alternate;
}
@keyframes blink { from { opacity: 0.4; } to { opacity: 1; } }

.blink{
    animation: blink 0.5s infinite alternate;
}

.alert-content { 
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); 
    text-align: center; color: white; background: rgba(0,0,0,0.8); padding: 30px;
    border: 2px solid red;
}

#eta-container { display: flex; justify-content: center; gap: 15px; margin-top: 20px; flex-wrap: wrap; }
.eta-box { 
    background: rgba(0,0,0,0.9); padding: 10px; border: 1px solid var(--neon-red); 
    min-width: 100px; text-align: center;
}
.eta-timer { font-size: 1.5rem; display: block; color: var(--neon-red); }
.eta-label { font-size: 0.7rem; display: block; margin-bottom: 5px; }


/* Botón Flotante para el Panel */
.toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--panel-bg);
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
    padding: 10px 15px;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* Estado del Sidebar Oculto */
#sidebar.hidden {
    display: none !important;
}

/* --- MEDIA QUERY PARA MÓVILES --- */
@media (max-width: 768px) {
    #container {
        flex-direction: column; /* Mapa arriba, lista abajo o superpuesta */
    }

    #sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 60vh; /* Un poco más alto para ver mejor los datos */
        border-left: none;
        border-top: 2px solid var(--neon-blue);
        z-index: 1001;
    }

    @media (orientation: landscape) {
        #sidebar {
            width: 320px;
            height: 100vh;
            right: 0;
            left: auto;
            top: 0;
            border-left: 2px solid var(--neon-blue);
        }
    }

    #canvas-container {
        height: 100vh; /* El mapa siempre ocupa todo el fondo */
        width: 100vw;
    }
}

#footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 32px;
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    overflow: hidden;
    font-family: sans-serif;
    font-size: 14px;
    z-index: 9999;
}

/* Zona de la marquesina */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  background: #111;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
}

.marquee-track {
  display: inline-flex;
  align-items: center;
  will-change: transform;
}

.marquee-item {
  display: inline-block;
  padding-right: 40px; /* gap interno entre items */
  box-sizing: border-box;
}

/* Pausa al hover/focus */
.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track {
  animation-play-state: paused !important;
}

.marquee-item a{
    color:white;
}
.marquee-item a:visited{
    color:white;
}


/* Bloques fijos a la derecha */
.fixed-block {
    padding: 0 12px;
    border-left: 1px solid #444;
    white-space: nowrap;
}

.big-quakes {
    background: #222;
    min-width: 560px;
    text-align: center;
}

.status {
    background: #1a1a1a;
    color: #0f0;
    min-width:120px;
    text-align:right;
}


.hidden {
    display: none !important;
}

.recentSignificant{
    margin-right:40px;
    padding-right:10px !important;
}

#main-logo {
    position: fixed;
    top: 10px;
    left: 20px;
    z-index: 50; /* Por debajo del botón pero por encima del mapa */
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: none; /* Para que no interfiera con los clicks en el mapa */
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 4px;
    border-left: 3px solid var(--neon-blue);
}

.logo-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 5px var(--neon-blue));
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-text .brand {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--neon-green);
    letter-spacing: 2px;
}

.logo-text .tld {
    color: var(--neon-blue);
    font-weight: bold;
}

.logo-text .tagline {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-top: 4px;
    color: var(--neon-blue);
}

/* Ajuste para móviles */
@media (max-width: 768px) {
    #main-logo {
        top: 10px;
        left: 10px;
        padding: 5px 10px;
    }
    .logo-text .brand { font-size: 1.1rem; }
    .big-quakes, .status { display: none !important; } /* Ocultamos el eslogan en móvil para limpiar */
}

/* Animación de pulso rojo */
@keyframes logo-emergency {
    0% { border-left-color: var(--neon-blue); text-shadow: 0 0 10px rgba(0, 212, 255, 0.5); }
    50% { border-left-color: var(--neon-red); text-shadow: 0 0 20px var(--neon-red); transform: scale(1.05); }
    100% { border-left-color: var(--neon-blue); text-shadow: 0 0 10px rgba(0, 212, 255, 0.5); }
}

/* Clase que aplicaremos por JS */
.logo-alert {
    animation: logo-emergency 1s infinite alternate !important;
    border-left: 3px solid var(--neon-red) !important;
}

.logo-alert .tld, .logo-alert .tagline {
    color: var(--neon-red) !important;
}

.pointer{
    cursor:pointer;
}
.pointer:hover{
    text-decoration: underline;
}

#divcfg{
    display:none;
}

.map-selector {
    display: flex;
    gap: 15px;
    font-size: 30px; /* Tamaño del emoji */
}

.map-option {
    cursor: pointer;
    padding: 8px;
    border: 2px solid transparent; /* Borde invisible por defecto */
    border-radius: 12px;           /* Bordes redondeados */
    transition: all 0.3s ease;     /* Animación suave */
    line-height: 1;
    user-select: none;             /* Evita que se resalte el texto al hacer click */
    background-color: transparent; /* Aseguramos que sea transparente */
}

/* Estilo cuando está seleccionado */
.map-option.selected {
    border-color: #007bff;         /* Color del borde (azul en este caso) */
    background-color: #f0f8ff;     /* Un fondo ligero opcional */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Efecto al pasar el ratón */
.map-option:hover {
    background-color: #f5f5f5;
}

/* Estilo para cuando está ACTIVADO (Verde) */
.map-option#alarm-toggle.selected {
    border-color: #28a745; 
    background-color: #e8f5e9; /* Fondo verde clarito */
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

/* Estilo para cuando está DESACTIVADO (Opcional: un gris suave o nada) */
.map-option#alarm-toggle:not(.selected) {
    border-color: transparent;
    background-color: transparent;
    box-shadow: none; /* Quitamos cualquier sombra */
}

.panel-neon {
    position: relative; /* Necesario para que la X se mueva respecto a este div */
    padding: 20px;
    /* Tu estilo actual... */
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 32px;
    font-weight: bold;
    color: #00ffff; /* Color neón a juego con tu mapa */
    cursor: pointer;
    line-height: 1;
    transition: 0.3s;
}

.close-btn:hover {
    color: #ff0000; /* Cambia a rojo al pasar el ratón */
    text-shadow: 0 0 10px #ff0000;
}