/* ================================================================
   COMPACT WEATHER WIDGET — animated SVG + 2-column data
   ================================================================ */

/* Widget Container */
.weather-widget {
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    max-width: 520px;
}

.weather-widget--severe {
    background: linear-gradient(135deg, #fff3e0 0%, #fce4ec 100%);
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.15);
}

.weather-widget--loading {
    opacity: 0.7;
}

/* Inner flex: illustration + data side by side */
.weather-widget__inner {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* Animated SVG illustration */
.weather-widget__illustration {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.weather-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Data container */
.weather-widget__data {
    flex: 1;
    min-width: 0;
}

/* Header: location + badge */
.weather-widget__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.weather-widget__location {
    font-weight: 700;
    font-size: 0.8rem;
    color: #1565c0;
    font-family: 'Playfair Display', serif;
}

/* 2-column grid */
.weather-widget__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.weather-widget__col {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.weather-widget__item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.75rem;
    line-height: 1.55;
    padding: 1px 0;
}

.weather-widget__item--condition {
    font-size: 0.72rem;
    color: #333;
    padding-top: 2px;
}

.weather-widget__label {
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.weather-widget__value {
    color: #1a237e;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

/* Alert bar at the bottom */
.weather-widget__alert {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    line-height: 1.4;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.weather-widget__alert.alert-red {
    background: #ffebee;
    border-left: 3px solid #d32f2f;
    color: #b71c1c;
}

.weather-widget__alert.alert-orange {
    background: #fff3e0;
    border-left: 3px solid #f57c00;
    color: #e65100;
}

.weather-widget__alert.alert-yellow {
    background: #fffde7;
    border-left: 3px solid #f9a825;
    color: #f57f17;
}

/* Severity Badges */
.badge-red {
    background-color: #ffcdd2;
    color: #b71c1c;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
}

.badge-orange {
    background-color: #ffe0b2;
    color: #e65100;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
}

.badge-yellow {
    background-color: #fff9c4;
    color: #f57f17;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
}

/* ================================================================
   SVG ANIMATIONS
   ================================================================ */

/* Sun — gentle rotate rays */
.weather-svg--sunny .sun-core {
    animation: sunPulse 3s ease-in-out infinite;
}

.weather-svg--sunny .sun-rays {
    animation: sunSpin 12s linear infinite;
    transform-origin: 60px 60px;
}

@keyframes sunPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

@keyframes sunSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Heatwave shimmer */
.heat-waves path {
    animation: heatShimmer 2s ease-in-out infinite alternate;
}

.heat-waves path:nth-child(2) {
    animation-delay: 0.4s;
}

@keyframes heatShimmer {
    0% { transform: translateY(0); opacity: 0.3; }
    100% { transform: translateY(-3px); opacity: 0.6; }
}

/* Clouds — gentle float */
.cloud--main {
    animation: cloudDrift 6s ease-in-out infinite alternate;
}

.cloud--left {
    animation: cloudDrift 5s ease-in-out infinite alternate-reverse;
}

.cloud--right {
    animation: cloudDrift 7s ease-in-out infinite alternate;
}

.sun-peek {
    animation: sunPeek 4s ease-in-out infinite;
}

@keyframes cloudDrift {
    0% { transform: translateX(0); }
    100% { transform: translateX(3px); }
}

@keyframes sunPeek {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.35; }
}

/* Rain drops — falling */
.raindrops .drop {
    animation: rainFall 1s linear infinite;
    opacity: 0;
}

.drop--1 { animation-delay: 0s; }
.drop--2 { animation-delay: 0.2s; }
.drop--3 { animation-delay: 0.4s; }
.drop--4 { animation-delay: 0.6s; }
.drop--5 { animation-delay: 0.15s; }

@keyframes rainFall {
    0% { opacity: 0; transform: translateY(-6px); }
    20% { opacity: 0.8; }
    80% { opacity: 0.8; }
    100% { opacity: 0; transform: translateY(12px); }
}

/* Thunder bolt flash */
.bolt--1 {
    animation: boltFlash 3s ease-in-out infinite;
}

@keyframes boltFlash {
    0%, 85%, 100% { opacity: 0; }
    87% { opacity: 1; }
    89% { opacity: 0; }
    91% { opacity: 0.8; }
    93% { opacity: 0; }
}

/* Mist — fade lines */
.mist-lines line {
    animation: mistDrift 4s ease-in-out infinite alternate;
}

.mist-lines line:nth-child(1) { animation-delay: 0s; }
.mist-lines line:nth-child(2) { animation-delay: 0.5s; }
.mist-lines line:nth-child(3) { animation-delay: 1s; }
.mist-lines line:nth-child(4) { animation-delay: 1.5s; }
.mist-lines line:nth-child(5) { animation-delay: 2s; }

@keyframes mistDrift {
    0% { transform: translateX(-4px); opacity: 0.3; }
    100% { transform: translateX(4px); opacity: 0.6; }
}

/* Warning pulse ring */
.pulse-ring {
    animation: pulseExpand 2s ease-out infinite;
    transform-origin: 60px 60px;
}

@keyframes pulseExpand {
    0% { opacity: 0.4; transform: scale(0.9); }
    100% { opacity: 0; transform: scale(1.25); }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 576px) {
    .weather-widget {
        max-width: 100%;
        padding: 8px 10px;
    }

    .weather-widget__illustration {
        width: 68px;
        height: 68px;
    }

    .weather-widget__location {
        font-size: 0.72rem;
    }

    .weather-widget__item {
        font-size: 0.7rem;
    }

    .weather-widget__grid {
        gap: 0 8px;
    }
}

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
    .weather-svg * {
        animation: none !important;
    }
}
