@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    transition: background 2s ease, color 2s ease;
    position: relative;
}

/* Canvas animado */
#weather-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Dashboard */
.weather-dashboard {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 90%;
    max-width: 900px;
}

.weather-dashboard h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.weather-dashboard p a {
    color: #ffd700;
    text-decoration: none;
    font-weight: 600;
}

#route-btn {
    margin: 1rem 0;
    padding: 0.6rem 1rem;
    border-radius: 0.8rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    background: #ffcc00;
    transition: background 0.3s, transform 0.2s;
    z-index: 2;
    position: relative;
}

#route-btn:hover {
    background: #ffd633;
    transform: scale(1.05);
}

/* Grid de cards */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    z-index: 2;
    position: relative;
}

/* Cards */
.weather-card {
    backdrop-filter: blur(15px) saturate(160%);
    -webkit-backdrop-filter: blur(15px) saturate(160%);
    background: rgba(255, 255, 255, 0.25);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.weather-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle at var(--ref-x, 50%) var(--ref-y, 50%),
            rgba(255, 255, 255, 0.35) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            transparent 80%);
    transform: translate(-10%, -10%) rotate(25deg);
    filter: blur(40px) brightness(1.8);
    pointer-events: none;
    transition: transform 0.1s ease, background 0.1s ease;
}

.weather-card h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.weather-card .temp {
    font-size: 2.5rem;
    font-weight: 600;
    color: #00e5ff;
    margin-top: 0.25rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.weather-card .condition {
    margin-top: 0.5rem;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.weather-card .weather-icon svg {
    display: block;
    margin: 0 auto;
}

/* Última actualización */
.last-updated {
    position: fixed;
    bottom: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 0.9rem;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
    z-index: 10;
    transition: background 0.5s ease, color 0.5s ease;
}

/* Responsive */
@media (max-width:600px) {
    .cards-container {
        grid-template-columns: 1fr;
    }

    .weather-dashboard h1 {
        font-size: 2rem;
    }

    .weather-card {
        padding: 1rem;
    }
}

/* Temas fondo */
body[data-theme="morning"] {
    background: linear-gradient(120deg, #8ad6ff, #fff9c4);
}

body[data-theme="day"] {
    background: linear-gradient(120deg, #33b1ff, #e1f5fe);
}

body[data-theme="sunset"] {
    background: linear-gradient(120deg, #ff8c42, #ffb882);
}

body[data-theme="night"] {
    background: linear-gradient(120deg, #2c3e50, #34495e);
}