* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 1.2s ease-in-out;
}

.weather-card {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 680px;
}

.header {
    text-align: center;
    margin-bottom: 15px;
}

/* Marca compartida del sitio (../assets/marca.css) */
.header .marca {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 1.45rem;
}

.header h1 {
    color: #111;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.date {
    color: #666;
    font-size: 0.85rem;
}

.weather-main {
    background: linear-gradient(135deg, #9300D3, #5c0085);
    color: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-bottom: 15px;
}

.main-icon {
    width: 65px;
    height: 65px;
}

.weather-main svg {
    stroke: #ffffff !important;
}

.temp {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
}

.feels-like {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 4px;
}

.description {
    font-size: 1rem;
    font-weight: 500;
}

/* Caja de Lluvia Condicional */
.rain-alert-box {
    background-color: #e8f4fd;
    border-left: 4px solid #2196f3;
    color: #1976d2;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Grid de Detalles */
.weather-details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    background-color: #f8f8fb;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 15px;
    text-align: center;
}

.detail-item span {
    display: block;
    font-size: 0.7rem;
    color: #777;
    text-transform: uppercase;
}

.detail-item strong {
    font-size: 0.85rem;
    color: #9300D3;
}

/* Información del Sol */
.sun-info-box {
    display: flex;
    justify-content: space-between;
    background: #faf5ff;
    border: 1px solid #f0e0ff;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.8rem;
    color: #444;
    margin-bottom: 20px;
}

/* Pronóstico Diario (Preparado para clics futuros) */
.forecast-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.forecast-day {
    background-color: #ffffff;
    border: 2px solid #9300D3;
    border-radius: 12px;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.forecast-day:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(147, 0, 211, 0.2);
}

.day-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
}

.forecast-icon {
    width: 28px;
    height: 28px;
}

.temp-max {
    font-weight: bold;
    color: #9300D3;
    font-size: 0.8rem;
}

.temp-min {
    color: #666;
    font-size: 0.8rem;
}

.forecast-extra {
    font-size: 0.68rem;
    color: #555;
    text-align: center;
    margin-top: 2px;
}

.rain-prob {
    color: #0275d8;
    font-weight: bold;
}

/* Fondos */
body.bg-foggy {
    background: linear-gradient(135deg, #bdc3c7, #2c3e50);
}

body.bg-windy {
    background: linear-gradient(135deg, #748892, #37474f);
}

body.bg-night {
    background: linear-gradient(135deg, #0d0914, #261233, #4a154b);
}

body.bg-sunny {
    background: linear-gradient(135deg, #70e1f5, #ffd194);
}

body.bg-cloudy {
    background: linear-gradient(135deg, #606c88, #3f4c6b);
}

body.bg-rainy {
    background: linear-gradient(135deg, #373b44, #4286f4);
}

/* Animaciones */
.animate-spin {
    transform-origin: center;
    animation: spin 12s linear infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-rain {
    animation: rain 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

@keyframes rain {
    0% {
        transform: translateY(-2px);
        opacity: 1;
    }

    100% {
        transform: translateY(3px);
        opacity: 0;
    }
}

/* FONDOS DINÁMICOS */

/* 1. Niebla en Valladolid (Tonos caliginosos/brumosos blanquecinos) */
body.bg-foggy {
    background: linear-gradient(135deg, #bdc3c7, #2c3e50);
}

/* 2. Viento (Verde grisáceo aerodinámico) */
body.bg-windy {
    background: linear-gradient(135deg, #748892, #37474f);
}

/* 3. Noche */
body.bg-night {
    background: linear-gradient(135deg, #0d0914, #261233, #4a154b);
}

/* 4. Día Despejado */
body.bg-sunny {
    background: linear-gradient(135deg, #70e1f5, #ffd194);
}

/* 5. Día Nublado */
body.bg-cloudy {
    background: linear-gradient(135deg, #606c88, #3f4c6b);
}

/* 6. Lluvia */
body.bg-rainy {
    background: linear-gradient(135deg, #373b44, #4286f4);
}

/* Tarjeta Principal */
.weather-card {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 650px;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    color: #111;
    font-size: 1.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.date {
    color: #666;
    font-size: 0.85rem;
}

/* Tarjeta Central Destacada (Estilo Blanquivioleta) */
.weather-main {
    background: linear-gradient(135deg, #9300D3, #5c0085);
    color: white;
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-bottom: 20px;
}

.main-icon {
    width: 70px;
    height: 70px;
}

/* Cambiar el color de los SVG dentro del bloque principal a blanco */
.weather-main svg {
    stroke: #ffffff !important;
}

.temp-group {
    text-align: right;
}

.temp {
    font-size: 3.5rem;
    font-weight: bold;
    line-height: 1;
}

.description {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 5px;
}

/* Detalles (Viento y Humedad) */
.weather-details {
    display: flex;
    justify-content: space-around;
    padding: 12px;
    background-color: #f8f8fb;
    border-radius: 12px;
    margin-bottom: 25px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-item span {
    font-size: 0.75rem;
    color: #777;
    text-transform: uppercase;
}

.detail-item strong {
    font-size: 0.95rem;
    color: #9300D3;
}

/* Pronóstico Horizontal de Días */
.forecast-section h3 {
    display: none;
    /* Ocultamos el título para mantenerlo limpio */
}

.forecast-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.forecast-day {
    background-color: #ffffff;
    border: 2px solid #9300D3;
    border-radius: 12px;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.day-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
}

.forecast-icon {
    width: 32px;
    height: 32px;
}

.temp-max {
    font-weight: bold;
    color: #9300D3;
    font-size: 0.85rem;
}

.temp-min {
    color: #666;
    font-size: 0.85rem;
}

/* Animaciones */
.animate-spin {
    transform-origin: center;
    animation: spin 12s linear infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-rain {
    animation: rain 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

@keyframes rain {
    0% {
        transform: translateY(-2px);
        opacity: 1;
    }

    100% {
        transform: translateY(3px);
        opacity: 0;
    }
}

/* Reloj digital en vivo */
.live-clock {
    font-size: 1.2rem;
    font-weight: 700;
    color: #9300D3;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Grupo de descripción y última actualización */
.weather-status-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.last-update {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 4px;
}