/* ── Weather Card Visuals ────────────────────────────────────────────────── */

.weather-visual {
    position: relative;
    width: 100%;
    height: 120px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
}

.weather-icon-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wico {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
    animation: float 3s ease-in-out infinite;
}

/* ── Floating Animation ──────────────────────────────────────────────────── */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

/* ── Sunny Weather ───────────────────────────────────────────────────────── */
.weather-sunny .weather-visual {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.1));
    position: relative;
}

.weather-sunny .weather-visual::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: sun-glow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sun-glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.4),
                    0 0 40px rgba(255, 152, 0, 0.2);
    }
    50% { 
        box-shadow: 0 0 30px rgba(255, 193, 7, 0.6),
                    0 0 60px rgba(255, 152, 0, 0.3);
    }
}

/* ── Cloudy Weather ──────────────────────────────────────────────────────── */
.weather-cloudy .weather-visual {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(203, 213, 225, 0.1));
    position: relative;
}

.weather-cloudy .weather-visual::before {
    content: '';
    position: absolute;
    width: 140px;
    height: 60px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    top: 30%;
    left: 20%;
    animation: cloud-drift 8s ease-in-out infinite;
    pointer-events: none;
}

.weather-cloudy .weather-visual::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 50px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    bottom: 25%;
    right: 15%;
    animation: cloud-drift 10s ease-in-out infinite reverse;
    pointer-events: none;
}

@keyframes cloud-drift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(20px); }
}

/* ── Rainy Weather ───────────────────────────────────────────────────────── */
.weather-rainy .weather-visual {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.2), rgba(100, 116, 139, 0.15));
    position: relative;
}

.weather-rainy .weather-visual::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to bottom, transparent 0%, transparent 40%, rgba(100, 150, 200, 0.3) 40%, rgba(100, 150, 200, 0.3) 45%, transparent 45%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, transparent 50%, rgba(100, 150, 200, 0.3) 50%, rgba(100, 150, 200, 0.3) 55%, transparent 55%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, transparent 60%, rgba(100, 150, 200, 0.3) 60%, rgba(100, 150, 200, 0.3) 65%, transparent 65%, transparent 100%);
    background-size: 20px 100%, 30px 100%, 25px 100%;
    background-position: 0 0, 10px 0, 5px 0;
    animation: rain-fall 1.5s linear infinite;
    pointer-events: none;
}

@keyframes rain-fall {
    0% { transform: translateY(-20px); }
    100% { transform: translateY(60px); }
}

/* ── Snowy Weather ───────────────────────────────────────────────────────── */
.weather-snowy .weather-visual {
    background: linear-gradient(135deg, rgba(203, 213, 225, 0.2), rgba(226, 232, 240, 0.15));
    position: relative;
}

.weather-snowy .weather-visual::before {
    content: '❄ ❄ ❄ ❄ ❄';
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.4);
    animation: snow-fall 3s linear infinite;
    pointer-events: none;
}

@keyframes snow-fall {
    0% { transform: translateY(-30px); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100px); opacity: 0; }
}

/* ── Stormy Weather ──────────────────────────────────────────────────────── */
.weather-stormy .weather-visual {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.3), rgba(30, 41, 59, 0.25));
    position: relative;
}

.weather-stormy .weather-visual::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: storm-flash 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes storm-flash {
    0%, 90%, 100% { opacity: 0.3; }
    95% { opacity: 1; }
}

/* ── Misty/Foggy Weather ─────────────────────────────────────────────────── */
.weather-misty .weather-visual {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.25), rgba(203, 213, 225, 0.15));
    position: relative;
}

.weather-misty .weather-visual::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 100% 50% at 50% 0%, rgba(255, 255, 255, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse 100% 50% at 50% 100%, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    animation: fog-drift 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes fog-drift {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* ── Responsive Adjustments ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .weather-visual {
        height: 100px;
    }

    .wico {
        width: 60px;
        height: 60px;
    }

    .weather-sunny .weather-visual::before {
        width: 80px;
        height: 80px;
    }

    .weather-cloudy .weather-visual::before {
        width: 100px;
        height: 50px;
    }

    .weather-cloudy .weather-visual::after {
        width: 90px;
        height: 40px;
    }
}

/* ── Smooth Transitions ──────────────────────────────────────────────────── */
.wcard {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wcard:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

/* ── Performance Optimization ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .wico,
    .weather-visual::before,
    .weather-visual::after {
        animation: none !important;
    }
}
