/* =============== DEROWEB - ESTILO: CYBER DARK (Blue/Green Tech) =================== */
:root {
    /* TEXTO: Blanco Hielo (Alto contraste sobre oscuro) */
    --text-dark: #f8fafc; 
    
    /* BORDES: Blanco muy transparente (sutil) */
    --border-light: rgba(255, 255, 255, 0.1); 
    
    /* FONDO TARJETAS: Azul/Gris Oscuro Profundo */
    --bg-card: #1e293b; 
    
    /* COLORES NEÓN (Para resaltar sobre fondo oscuro) */
    --color-hot: #fb7185;   /* Rosa/Rojo Neón */
    --color-rain: #38bdf8;  /* Azul Cielo Brillante */
    --color-hum: #2dd4bf;   /* Turquesa/Teal (El tono de tu referencia) */
    --color-wind: #94a3b8;  /* Gris Metalizado */
}

body {
    /* FONDO: Azul Noche Profundo (Casi negro, pero con tinte azul) */
    background-color: #0f172a; 
    min-height: 100vh;
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    overflow-x: hidden;
}

header {
    /* GRADIENTE: Oscuro arriba -> Se funde con el fondo #0f172a */
    background: 
        linear-gradient(to bottom, 
            rgba(2, 6, 23, 0.2) 0%,        /* Casi negro arriba */
            rgba(15, 23, 42, 0.3) 80%,     /* Transparencia media */
            #0f172a 100%),                 /* Color sólido del body al final */
        url('images2027/fondo-meteo2027-52.jpg'); /*46*/

    background-size: cover;
    background-position: center 10%; /*26*/
    background-repeat: no-repeat;
    box-shadow: none; 
    padding-bottom: 8rem; 
    margin-bottom: -7rem; 
    position: relative;
    z-index: 0;
}

main {
    position: relative;
    z-index: 1; 
}

/* --- NAVBAR & GENERAL --- */
.navbar-custom { padding-top: 1rem; }
.navbar-brand { text-shadow: 0 2px 10px rgba(0,0,0,0.8); }

.navbar-collapse { 
    /* Fondo oscuro semitransparente (Glassmorphism Dark) */
    background-color: rgba(30, 41, 59, 0.95); 
    border-radius: 12px; 
    padding: 0.5rem 1rem; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    flex-grow: 0; 
}

.nav-link { color: #f1f5f9 !important; font-weight: 600; }
.navbar-toggler i { color: #ffffff !important; }

/* --- TARJETAS (ESTILO DARK TECH) --- */
.hero-card, .weather-card { 
    background-color: var(--bg-card) !important; 
    
    /* Borde fino brillante */
    border: 1px solid var(--border-light); 
    
    border-radius: 16px; 
    
    /* Sombra negra suave para dar profundidad */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 
                0 2px 4px -1px rgba(0, 0, 0, 0.1);
    
    height: 100%; 
    overflow: hidden; 
    transition: none; 
    position: relative;
}

/* Encabezados de Tarjetas (Internas) */
.card-header {
    background-color: rgba(255, 255, 255, 0.03) !important; /* Ligeramente más claro */
    border-bottom: 1px solid var(--border-light) !important;
    color: #f1f5f9;
}

/* =========================================
   TIPOGRAFÍA
   ========================================= */
.card-label, .card-label-fixed { 
    font-size: 0.75rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    /* Gris azulado claro (Slate 400) */
    color: #94a3b8; 
    margin-bottom: 0.5rem !important;
    height: 15px; 
    display: flex;
    align-items: center;
}

.main-value, .main-value-fixed, .val-wind-large { 
    font-size: 2.3rem !important; 
    font-weight: 700 !important; 
    line-height: 1 !important; 
    letter-spacing: -1px; 
    /* Blanco Puro */
    color: #ffffff; 
    white-space: nowrap !important;
    display: flex;
    align-items: baseline;
    text-shadow: 0 0 20px rgba(255,255,255,0.1); /* Sutil resplandor */
}

.val-wind-large { justify-content: center; }
.main-value, .main-value-fixed { justify-content: flex-start; }

.unit, .unit-fixed { 
    font-size: 1rem !important; 
    font-weight: 500; 
    opacity: 0.7; 
    margin-left: 4px;
    color: #cbd5e1;
}

i.bi { color: var(--text-dark) !important; }

/* =========================================
   LAYOUT & COMPONENTES
   ========================================= */
.card-split-layout { 
    display: flex !important; 
    flex-direction: row !important; 
    align-items: stretch; 
    justify-content: space-between; 
    padding: 1.5rem !important; 
    height: 100%; 
    gap: 10px; 
}
.data-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.visual-col { 
    flex: 0 0 auto; width: 30%; min-width: 60px; 
    display: flex; justify-content: flex-end; align-items: flex-end; 
    position: relative; padding-bottom: 5px; 
}
.visual-col.center-v { align-items: center; padding-bottom: 0; }

/* Datos Secundarios */
.row-max-min { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8rem; line-height: 1.4; width: 100%; }
.mm-group { display: flex; align-items: baseline; gap: 4px; }
.mm-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: #64748b; }
.mm-val { font-weight: 700; color: #f1f5f9; }
.mm-time { font-size: 0.65rem; color: #94a3b8; font-weight: 500; }
.data-divider { border-top: 1px solid rgba(255,255,255,0.1); margin: 8px 0; } 
.sub-block-title { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: #94a3b8; display: block; letter-spacing: 0.5px; }
.sub-block-val { font-size: 1.8rem; font-weight: 700; color: #f8fafc; line-height: 1; }
.history-grid { display: flex; justify-content: space-between; font-size: 0.75rem; margin-top: 4px; }
.history-item { display: flex; flex-direction: column; }
.history-lbl { font-size: 0.6rem; color: #64748b; text-transform: uppercase; font-weight: 700; }
.history-val { font-weight: 700; color: #e2e8f0; }

/* --- GRÁFICOS VISUALES --- */
.visual-full-height { width: 100%; height: 100%; position: relative; }

/* Termómetro (Adaptado a Dark) */
.thermometer-track { 
    width: 12px; height: 100%; position: absolute; right: 0; bottom: 0; 
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 10px; overflow: hidden; z-index: 1; 
}
.thermometer-bulb { 
    position: absolute; bottom: -5px; right: -4px; width: 20px; height: 20px; 
    /* CAMBIO: Usar variable dinámica --temp-color */
    background-color: var(--temp-color, #fb7185); 
    border-radius: 50%; z-index: 4; 
    border: 1px solid rgba(255,255,255,0.2); transition: background-color 1s; 
    box-shadow: 0 0 10px var(--temp-color, #fb7185); 
}

.thermometer-labels { position: absolute; right: 18px; height: 100%; bottom: 0; width: 20px; pointer-events: none; }
.visual-label { position: absolute; right: 0; text-align: right; font-size: 0.6rem; font-weight: 700; color: #64748b; transform: translateY(-50%); }
.internal-ticks { position: absolute; top:0; left:0; width:100%; height:100%; z-index:3; }
.tick { position: absolute; left: 10%; width: 80%; height: 1px; background: rgba(255,255,255,0.2); }
.mercury-fill { 
    width: 100%; position: absolute; bottom: 0; left: 0; 
    height: var(--temp-percent, 0%); 
    /* CAMBIO: Usar variable dinámica --temp-color */
    background-color: var(--temp-color, #fb7185); 
    transition: height 1s; z-index: 2; 
    /* CAMBIO CLAVE: La sombra va hacia abajo (5px) para no falsear la lectura superior */
    box-shadow: 0 5px 10px var(--temp-color, #fb7185); 
}
.t-pos-40 { top: 2%; } .t-pos-30 { top: 23%; } .t-pos-20 { top: 44.5%; } .t-pos-10 { top: 65.6%; } .t-pos-0 { top: 86.9%; }

/* Humedad */
.humidity-visual-container { width: 100%; height: 100%; display: flex; align-items: center; justify-content: flex-end; }
.humidity-drop { 
    width: 55px; height: 85px; 
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); 
    clip-path: path("M27.5,0 C27.5,0 55,40 55,60 A27.5,27.5 0 1,1 0,60 C0,40 27.5,0 27.5,0 Z"); 
    position: relative; overflow: hidden; 
}
.humidity-fill { 
    width: 100%; height: var(--hum-percent, 0%); background-color: var(--color-hum); 
    transition: height 1s ease-in-out; opacity: 0.9; position: absolute; bottom: 0; left: 0; z-index: 1; 
    box-shadow: 0 0 15px var(--color-hum); /* Glow Turquesa */
}
.humidity-drop svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

/* Pluviómetro */
.rain-tube { 
    width: 50px; height: 100%; background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1); border-bottom: 2px solid rgba(255,255,255,0.2); 
    border-radius: 0 0 6px 6px; position: absolute; right: 0; bottom: 0; overflow: hidden; 
}
.rain-labels-container { position: absolute; right: 55px; height: 100%; width: 25px; bottom: 0; pointer-events: none; }
.rain-mark { position: absolute; right: 0; text-align: right; font-size: 0.6rem; font-weight: 700; color: #94a3b8; transform: translateY(-50%); }
.rain-ticks { position: absolute; top:0; left:0; width:100%; height:100%; }
.rtick { position: absolute; left: 0; width: 40%; height: 1px; background: rgba(0,0,0,0.9); }

/* --- PLUVIÓMETRO CON EFECTO "AGUA VIVA" --- */
.rain-fill {
    width: 100%; position: absolute; bottom: 0; left: 0;
    height: var(--rain-percent, 0%); background-color: var(--color-rain);
    transition: height 1s; opacity: 0.9; z-index: 1;
    box-shadow: 0 0 15px var(--color-rain); /* Glow Azul */
}
.rain-fill::after {
    content: ""; position: absolute; top: -1px; left: -10%; width: 120%; height: 4px;
    background: rgba(255, 255, 255, 0.8); border-radius: 50%;
    animation: waterWave 2s infinite ease-in-out;
}
@keyframes waterWave {
    0% { transform: translateY(0px) rotate(0deg) scaleX(0.95); opacity: 0.6; }
    50% { transform: translateY(-1px) rotate(2deg) scaleX(1.05); opacity: 0.9; }
    100% { transform: translateY(0px) rotate(0deg) scaleX(0.95); opacity: 0.6; }
}

#rain-active-container { display: none; margin-left: 10px; flex-direction: column; align-items: center; justify-content: center; }
.is-raining-anim { width: 20px; height: 20px; position: relative; overflow: hidden; margin-bottom: 0; }
.rain-drop { position: absolute; top: -10px; width: 2px; height: 6px; background: var(--color-rain); border-radius: 2px; animation: rainFall 0.8s linear infinite; }
.rain-drop:nth-child(1) { left: 5px; animation-delay: 0s; } .rain-drop:nth-child(2) { left: 10px; animation-delay: 0.3s; } .rain-drop:nth-child(3) { left: 15px; animation-delay: 0.5s; }
.rain-rate-text { font-size: 0.65rem; font-weight: 700; white-space: nowrap; color: var(--color-rain); line-height: 1; }
@keyframes rainFall { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(35px); opacity: 0; } }

/* =========================================
   TARJETA VIENTO
   ========================================= */
.card-triple-layout {
    display: flex; flex-direction: row; justify-content: space-between;
    padding: 1rem 0.5rem !important; height: 100%; gap: 5px; overflow: hidden;
}
.col-wind-1 { flex: 0 0 33%; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; }
.col-wind-2 { flex: 0 0 34%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.col-wind-3 { flex: 0 0 33%; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; }
.col-wind-3 .card-label { width: 100%; justify-content: center; text-align: center; }

/* WIND ROSE (Ajuste a Dark - Invertido) */
.wind-rose-wrapper { width: 100%; height: auto; min-height: 110px; display: flex; align-items: center; justify-content: center; }
.wind-rose-svg { width: 100%; height: 100%; max-width: 120px; overflow: visible; }
.wr-grid-circle { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 0.5; stroke-dasharray: 2,2; }
.wr-axis { stroke: rgba(255,255,255,0.1); stroke-width: 0.5; }
.wr-wedge { fill: rgba(56, 189, 248, 0.3); stroke: var(--color-rain); stroke-width: 0.5; transition: d 1s ease; }
.wr-cardinal-lbl { font-size: 8px; font-weight: 700; fill: #94a3b8; text-anchor: middle; dominant-baseline: central; }
.wr-outer-ring { fill: none; stroke: #f1f5f9; stroke-width: 1.5; opacity: 0.8; }
.wr-current-arrow { fill: #f1f5f9; stroke: #0f172a; stroke-width: 1; transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1); }

/* MOLINO (Blanco sobre fondo oscuro) */
.windmill-wrapper { width: 100%; flex-grow: 1; display: flex; align-items: flex-end; justify-content: center; position: relative; max-height: 90px; overflow: visible; margin-top: 10px; }
.windmill-svg { height: 100%; width: auto; max-width: 80px; }
.windmill-svg path, .windmill-svg line, .windmill-svg circle, .windmill-svg rect { stroke: #e2e8f0; fill: #none; } /* Todo a blanco/gris claro */
.windmill-svg g[fill="none"] path { stroke: #64748b; fill: none; } /* Estructura un poco más oscura */

.wm-wheel-group { 
    transform-origin: 40px 20px !important;
    transform-box: view-box;
    will-change: transform; 
} 
@keyframes spinMolino { 
    from { transform: rotate(0deg); } 
    to { transform: rotate(360deg); } 
}

.dom-wind-box { margin-top: 4px; font-size: 0.75rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; }
.dir-info-box { text-align: center; margin-top: 12px; line-height: 1; }
.dir-text-main { font-size: 1.4rem; font-weight: 700; color: #ffffff; display: block; } 
.dir-text-sub { font-size: 0.9rem; font-weight: 500; color: #cbd5e1; margin-top: 2px; display: block; }

/* =========================================
   SPONSORS - CORRECCIÓN DEFINITIVA
   ========================================= */

/* 1. Aseguramos que la tarjeta use Flexbox vertical */
.sponsors-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important; /* O la altura fija que tenga tu fila */
    padding: 0.8rem !important;
    overflow: hidden; /* Corta cualquier cosa que intente salirse */
}

/* =========================================
   TITULO SPONSORS - IGUAL AL RESTO
   ========================================= */
.sponsors-label {
    /* Mismas propiedades que .card-label */
    font-size: 0.75rem !important; /* Tamaño estándar (12px aprox) */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    /* Color Slate 400 (#94a3b8) - El gris claro legible */
    color: #94a3b8 !important; 
    
    /* IMPORTANTE: Quitamos la opacidad que lo oscurecía */
    opacity: 1 !important; 
    
    margin-bottom: 0.5rem !important;
    
    /* Mantenemos el centrado porque queda mejor en esta tarjeta ancha,
       pero si lo quieres a la izquierda como las demás, cambia a 'left' */
    text-align: center; 
    display: block;
    width: 100%;
}

/* 3. La Grilla ocupa TODO el espacio restante disponible */
.sponsors-grid {
    display: grid;
    /* Dos columnas iguales */
    grid-template-columns: 1fr 1fr; 
    /* Dos filas iguales que ocupan el espacio restante */
    /* minmax(0, 1fr) es EL TRUCO: evita que el contenido estire la celda */
    grid-template-rows: repeat(2, minmax(0, 1fr)); 
    gap: 8px;
    flex-grow: 1; /* Ocupa todo el alto sobrante de la tarjeta */
    width: 100%;
    min-height: 0; /* Necesario para que flexbox scrollee/ajuste bien */
}

/* =========================================
   SPONSORS - SEGURIDAD TOTAL (NO CROP)
   ========================================= */

.sponsor-item {
    /* 1. Fondo del Mismo Color que tu GIF */
    /* Como tus GIFs tienen fondo #1e293b, ponemos el contenedor igual.
       Así, si la imagen se achica, el espacio sobrante no se nota. */
    background-color: #1e293b !important; 
    
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    padding: 0 !important;
    
    /* Centramos la imagen por si sobran bordes */
    display: flex;
    align-items: center;
    justify-content: center;
    
    width: 100%;
    height: 100%;
}

.sponsor-item img {
    width: 100%;
    height: 100%;
    
    /* 2. LA CLAVE: CONTAIN */
    /* 'contain': Escala la imagen lo más grande posible SIN salirse 
       y SIN recortar nada. Muestra el 100% de la imagen siempre. */
    object-fit: contain !important; 
    
    max-height: none !important;
}

/* =========================================
   BARÓMETRO (Invertido a Dark)
   ========================================= */
#barometer-card .data-col { flex: 0 0 55%; }
#barometer-card .visual-col { flex: 0 0 45%; justify-content: center; align-items: center; }
.barometer-svg-wrapper { width: 100%; max-width: 160px; }
.baro-face-bg { fill: rgba(255,255,255,0.02); }
.baro-face-grid { stroke: rgba(255,255,255,0.05); stroke-width: 0.5; }
.baro-bezel { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 2; }
.baro-text { font-family: 'Outfit', sans-serif; font-size: 5px; font-weight: 300; fill: #94a3b8; text-anchor: middle; }
.baro-unit-label { font-family: 'Outfit', sans-serif; font-size: 4px; font-weight: 400; fill: #64748b; text-anchor: middle; letter-spacing: 0.5px; }
.baro-tick-major { stroke: #cbd5e1; stroke-width: 0.6; stroke-linecap: round; }
.baro-tick-minor { stroke: #64748b; stroke-width: 0.4; stroke-linecap: butt; }
.baro-needle-min { fill: #fb7185; opacity: 0.9; } /* Rosa */
.baro-needle-max { fill: #34d399; opacity: 0.9; } /* Verde */
.baro-needle-curr-body { stroke: #f8fafc; stroke-width: 2; stroke-linecap: butt; }
.baro-needle-curr-head { fill: #f8fafc; }
.baro-needle-curr-counterweight { fill: #f8fafc; }
.baro-pivot { fill: #1e293b; stroke: #f8fafc; stroke-width: 0.8; }

/* =========================================
   OTROS
   ========================================= */
.map-card { padding: 0 !important; overflow: hidden; min-height: 250px; border: 1px solid rgba(255,255,255,0.1); }
.map-card iframe { width: 100%; height: 100%; border: none; display: block; }
.sun-cycle-container { width: 100%; min-height: 100px; }
.img-container { position: relative; height: 100%; background: #0f172a; }
.img-container img { width: 100%; height: 100%; object-fit: cover; }
.img-label { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.7); color: white; font-size: 0.65rem; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; border: 1px solid rgba(255,255,255,0.2); }
.forecast-day {
    /* ... tus estilos anteriores ... */
    flex: 0 0 auto !important; /* IMPORTANTE: Evita que se encojan */
    min-width: 100px; /* Ancho fijo mínimo */
}
.forecast-day:hover { background: rgba(255,255,255,0.1) !important; transform: translateY(-2px); }
#forecast-container { display: flex; gap: 8px; }

/* --- LUNA SVG --- */
#moon-svg { filter: drop-shadow(0 0 10px rgba(255,255,255,0.3)); }

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
} 

/* LOGO RESPONSIVE (Invertir si es oscuro, o dejar si es blanco) */
@media (max-width: 768px) {
    .logo-responsive {
        height: 55px !important; /*Estaba en 45*/
    }
}

/* ESTILOS BOTÓN MENÚ (HAMBURGUESA) */
.navbar-toggler {
    background-color: rgba(30, 41, 59, 0.7); 
    border-radius: px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}
.navbar-toggler i {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* Borde derecho solo en pantallas grandes */
@media (min-width: 992px) {
    .border-end-lg {
        border-right: 1px solid rgba(255,255,255,0.1);
    }
}

/* --- TOOLTIP CIENTÍFICO --- */
.formula-tooltip-container { position: relative; }
.formula-tooltip {
    visibility: hidden; width: 200px; background-color: rgba(15, 23, 42, 0.95);
    color: #fff; text-align: left; border-radius: 6px; padding: 10px;
    position: absolute; z-index: 100; top: 130%; right: 0;
    opacity: 0; transition: opacity 0.3s; font-size: 0.7rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2);
    pointer-events: none;
}
.formula-tooltip::after {
    content: ""; position: absolute; bottom: 100%; right: 5px; margin-left: -5px;
    border-width: 5px; border-style: solid;
    border-color: transparent transparent rgba(15, 23, 42, 0.95) transparent;
}
.formula-tooltip-container:hover .formula-tooltip { visibility: visible; opacity: 1; }

/* Animación de parpadeo para alertas */
@keyframes blink-alert {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}
.animated-blink { animation: blink-alert 0.5s infinite ease-in-out; }

/* --- BARRA DE CONFORT DE HUMEDAD (NUEVA PALETA AZUL/VERDE NEÓN) --- */
.hum-gauge-container {
    height: 100%; width: 100%; display: flex; align-items: center; justify-content: flex-end;
    padding-right: 5px; position: relative; min-height: 150px;
}
.hum-labels { position: relative; height: 100%; width: 60px; margin-right: 8px; }
.hl-text {
    position: absolute; right: 0; transform: translateY(-50%);
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    color: #94a3b8; opacity: 0.8;
}
.hum-track {
    width: 12px; height: 100%;
    /* GRADIENTE ... */
    background: linear-gradient(to top, 
        #34d399 0%, 
        #2dd4bf 35%, 
        #0ea5e9 60%, 
        #1e3a8a 100% 
    );
    border-radius: 6px; 
    position: relative; 
    
    /* CAMBIO AQUÍ: Quitamos el borde o lo ponemos en 0/none */
    border: none; 
    
    box-shadow: 0 0 3px rgba(45, 212, 191, 0.6);
}
.hum-tick { position: absolute; left: 0; width: 100%; height: 1px; background: rgba(255,255,255,0.5); z-index: 1; }
.hum-indicator {
    position: absolute; left: -6px; bottom: var(--hum-percent, 50%);
    width: 0; height: 0;
    border-top: 5px solid transparent; border-bottom: 5px solid transparent; 
    border-left: 6px solid #f8fafc; /* Indicador Blanco */
    transform: translateY(50%); transition: bottom 0.8s ease-out; z-index: 2;
    filter: drop-shadow(0 0 2px black);
}

/* --- TARJETA LUNA MEJORADA --- */
.moon-sky-container {
    width: 100%; height: 120px;
    /* Cielo nocturno profundo */
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
    position: relative; box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.05);
}
.stars-bg {
    width: 1px; height: 1px; background: transparent; position: absolute; top: 0; left: 0;
    box-shadow: 10px 10px #FFF, 40px 80px #FFF, 120px 30px #FFF, 180px 60px #FFF, 220px 100px #FFF, 50px 110px #FFF, 280px 40px #FFF, 150px 10px #FFF, 90px 90px #FFF;
    opacity: 0.6;
}
.stars-bg-2 {
    width: 2px; height: 2px; background: transparent; position: absolute; top: 0; left: 0;
    box-shadow: 120px 50px #FFF, 30px 20px #FFF, 200px 90px #FFF, 80px 80px #FFF;
    opacity: 0.9; animation: twinkle 8s infinite ease-in-out; 
}
@keyframes twinkle { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* Logo Sombra (Blanco brillante en dark mode) */
.logo-responsive { filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3)); transition: filter 0.3s ease; }

/* --- PERSONALIZACIÓN DE ESTADOS (Colores Sólidos Brillantes) --- */
#status-badge.bg-success { background-color: #10b981 !important; color: #fff; box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
#status-badge.bg-warning { background-color: #f59e0b !important; color: #000 !important; }
#status-badge.bg-danger { background-color: #ef4444 !important; box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }

/* --- ESTILOS ESPECÍFICOS: HEADER Y ESTADOS --- */

/* La pastilla de "Datos de las..." (Negro translúcido) */
.data-update-pill {
    background-color: rgba(0, 0, 0, 0.1); 
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: #f8fafc; 
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    height: 24px;
}

#status-badge {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(4px);
}

.data-update-pill i { color: #fff !important; }

/* --- OVERRIDES: ADAPTACIÓN BOOTSTRAP A MODO DARK --- */

/* Forzar que 'text-dark' sea BLANCO en este tema */
.text-dark { color: #f8fafc !important; }

/* Forzar que 'text-muted' sea GRIS CLARO legible */
.text-muted { color: #94a3b8 !important; }

/* Bordes sutiles en lugar de grises */
.border, .border-top, .border-bottom, .border-end, .border-start {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Alertas: Fondo transparente y texto claro */
.alert-danger {
    background-color: rgba(220, 38, 38, 0.9) !important;
    /*color: #fca5a5 !important;*/
	color: #ffffff !important;
    border: 1px solid rgba(220, 38, 38, 0.99) !important;
}

/* Iconos Bootstrap por defecto a gris claro */
i.bi:not(.text-warning):not(.text-danger):not(.text-success):not(.text-primary) {
    /*color: #cbd5e1 !important;*/
	color: #FFFFFF !important;
}

/* Fondo oscuro para elementos que eran 'bg-light' */
.bg-light { background-color: rgba(255,255,255,0.05) !important; }


/* --- PRONÓSTICO DARK --- */
.forecast-day {
    background-color: rgba(255, 255, 255, 0.03) !important; /* Fondo casi transparente */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;  /* Borde sutil */
    color: #f8fafc;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.forecast-day:hover {
    background-color: rgba(255, 255, 255, 0.08) !important; /* Un poco más claro al pasar mouse */
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.forecast-icon {
    font-size: 1.8rem;
    margin: 0.5rem 0;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.2)); /* Glow suave en iconos */
}


/* --- PRONÓSTICO HORARIO (AJUSTADO) --- */
#hourly-container::-webkit-scrollbar { display: none; }

.hourly-item {
    flex: 0 0 auto; 
    width: 75px;    /* Un poco más ancho para que entre el viento */
    min-height: 130px; /* Más alto para alojar todos los datos */
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Alinear arriba */
    gap: 2px;
    transition: all 0.2s ease;
}

.hourly-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.hourly-time {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hourly-temp {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f8fafc;
}

/* --- SCROLL FADE EFFECT --- */
.scroll-fade-wrapper {
    position: relative;
    height: 100%;
    overflow: hidden;
}

/* Sombra degradada a la derecha para indicar scroll */
.scroll-fade-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to right, transparent, var(--bg-card)); /* Se funde con el color de la tarjeta */
    pointer-events: none; /* Permite hacer clic/touch a través de la sombra */
    z-index: 10;
}

#hourly-container {
    cursor: grab; /* Manito para indicar que se puede arrastrar */
    padding-right: 40px !important; /* Espacio para que el último ítem no quede tapado por el fade */
}
#hourly-container:active {
    cursor: grabbing;
}

/* --- BOTONES DE SCROLL HORIZONTAL --- */
.scroll-nav-btn {
    position: absolute;
    top: 55%; /* Centrado verticalmente respecto al contenido */
    transform: translateY(-50%);
    z-index: 20;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(15, 23, 42, 0.8); /* Fondo oscuro */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 0.7rem;
}

.scroll-nav-btn:hover {
    background-color: #38bdf8; /* Azul Neón al hover */
    color: #fff;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.scroll-nav-btn.start-0 { left: 0; }
.scroll-nav-btn.end-0 { right: 0; }

/* Aseguramos que el contenedor oculte la barra nativa */
#hourly-container::-webkit-scrollbar { display: none; }


/* =========================================
   TABLAS ESTILO CYBER DARK (Corrección de Contraste)
   ========================================= */

.table-cyber {
    width: 100%;
    margin-bottom: 0;
    color: #f8fafc; /* Texto base blanco */
    vertical-align: middle;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Cabecera (Thead) */
.table-cyber thead th {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #94a3b8 !important; /* Slate 400 - Gris claro */
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1rem 0.5rem;
}

/* Celdas (Tbody) */
.table-cyber tbody td {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.8rem 0.5rem;
    font-size: 0.95rem;
    vertical-align: middle;
}

/* Fila Hover - Iluminar ligeramente */
.table-cyber tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* --- COLUMNAS Y TEXTOS --- */

/* Columna HOY (Destacada) */
.col-cyber-today {
    background-color: rgba(56, 189, 248, 0.08) !important; /* Azul muy tenue */
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: #ffffff !important; /* Blanco puro */
    font-weight: 700;
}

/* Columna PASADO (Ayer/Anteayer) */
.col-cyber-past {
    color: #e2e8f0 !important; /* Slate 200 - Casi blanco */
}

/* Etiquetas de fila (Variable) */
.table-cyber td.text-start {
    color: #cbd5e1 !important; /* Slate 300 - Gris muy claro */
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Valores Grandes (Números) */
.cyber-value-lg {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff !important; /* Blanco fuerza bruta */
    display: block;
    line-height: 1.2;
    text-shadow: 0 0 10px rgba(0,0,0,0.5); /* Sombra suave para separar del fondo */
}

/* Subtextos (Horas) */
.cyber-subtext {
    font-family: 'Outfit', monospace;
    font-size: 0.75rem;
    color: #94a3b8 !important; /* Slate 400 */
    margin-top: 2px;
    font-weight: 400;
}

/* Arreglo para iconos dentro de la tabla */
.table-cyber i.bi {
    color: inherit !important;
}