﻿body {
}

.card, .card-body {
    border-radius: 20px;
}


.chart-card {
    border: 1px solid #e6e6e6;
    border-radius: .75rem;
    padding: 12px;
}

.chart-wrap { /* desktop height, mobile override below */
    height: clamp(100px, 24vh, 2600px);
}

    .chart-wrap > canvas {
        display: block;
        height: 100% !important;
        width: 100% !important;
    }

/* Compact, consistent legend */
.chart-legend {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 10px 16px;
    line-height: 1.2;
    margin-top: 8px;
}

    .chart-legend .item {
        align-items: center;
        cursor: pointer;
        display: flex;
        gap: 8px;
        user-select: none;
    }

    .chart-legend .swatch {
        border-radius: 2px;
        height: 8px;
        outline: 1px solid rgba(0, 0, 0, .1);
        width: 14px;
    }

/* Mobile tweaks */
@media (max-width: 768px) {
    .chart-wrap {
        height: clamp(100px, 30vh, 160px);
    }

    .chart-legend {
        font-size: 11px;
        gap: 8px 12px;
    }
}

canvas {
    cursor: grab;
    touch-action: none;
}

    canvas:active {
        cursor: grabbing;
    }

.chart-wrap > canvas {
    touch-action: pan-y pinch-zoom;
}

/* compact, clean “daily list” look */
.daily-list details {
    border: 1px solid var(--border);
    border-radius: .75rem;
    background: var(--surface);
    padding: .75rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

    .daily-list details + details {
        margin-top: .75rem;
    }

.daily-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    color: var(--text);
}

    .daily-summary h3 {
        font-size: 1rem;
        margin: 0;
        font-weight: 600;
        min-width: 72px;
        color: var(--text);
    }

    .daily-summary .wx {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
        color: var(--text);
    }

    .daily-summary .temps {
        font-weight: 600;
    }

        .daily-summary .temps .low {
            color: #6c757d;
            font-weight: 500;
        }

    .daily-summary .pop {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 56px;
        justify-content: flex-end;
    }

.daily-pane h4 {
    font-size: .95rem;
    font-weight: 700;
    margin: 0 0 .25rem;
}

.daily-content .pane {
    border-radius: .75rem;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.temp-xl {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1;
}

.wxicon-lg {
    width: 42px;
    height: 42px;
}

.mini {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .35rem;
    font-size: .95rem;
}

.stat-card {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    padding: .75rem .9rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem 1rem;
}

    .stat-grid .cell {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: .5rem;
    }

    .stat-grid .rule {
        grid-column: 1 / -1;
        height: 1px;
        background: var(--bs-border-color);
        margin: .25rem 0;
    }

.wxicon {
    width: 36px;
    height: 36px;
}

summary::-webkit-details-marker {
    display: none;
}

/* summary layout closed */
.day-card .daily-summary {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: .5rem;
}

/* when open, show only the date (h3) */
.day-card[open] .daily-summary {
    display: block;
}

    .day-card[open] .daily-summary .wxicon,
    .day-card[open] .daily-summary .wx,
    .day-card[open] .daily-summary .pop {
        display: none !important;
    }

/* ─────────────────────────────────────────────
           Weather FX overlay (inside Current Conditions card)
           ───────────────────────────────────────────── */
.wx-fx-body {
    position: relative;
    overflow: hidden;
}

.wx-fx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.wx-fx__content {
    position: relative;
    z-index: 1;
}

.wx-fx__particles {
    position: absolute;
    inset: -12% 0 -12% 0;
}

.wx-fx__icon {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 84px;
    height: 84px;
    opacity: 0.18;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.15));
}

.wx-snowflake {
    position: absolute;
    top: -12%;
    opacity: 0.75;
    animation: wx-fall linear infinite;
    will-change: transform;
    color: rgba(120, 210, 255, 0.9);
}

.wx-raindrop {
    position: absolute;
    top: -15%;
    width: 2px;
    border-radius: 999px;
    opacity: 0.55;
    background: rgba(120, 190, 255, 0.9);
    animation: wx-rain linear infinite;
    will-change: transform;
}

@keyframes wx-fall {
    0% {
        transform: translateY(-10vh) translateX(0) rotate(var(--rot, 0deg));
    }

    25% {
        transform: translateY(30vh) translateX(10px) rotate(calc(var(--rot, 0deg) + 25deg));
    }

    50% {
        transform: translateY(60vh) translateX(-10px) rotate(calc(var(--rot, 0deg) + 50deg));
    }

    75% {
        transform: translateY(85vh) translateX(10px) rotate(calc(var(--rot, 0deg) + 75deg));
    }

    100% {
        transform: translateY(120vh) translateX(0) rotate(calc(var(--rot, 0deg) + 100deg));
    }
}

@keyframes wx-rain {
    0% {
        transform: translateY(-10vh) translateX(0) skewX(-15deg);
    }

    100% {
        transform: translateY(130vh) translateX(-30px) skewX(-15deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .wx-snowflake, .wx-raindrop {
        animation: none;
        display: none;
    }
}

/* Default rot fallback (nice to have; not required) */
.wx-snowflake {
    --rot: 0deg;
}

/* ─────────────────────────────────────────────
       Fog overlay (CSS haze layers, no particles)
       ───────────────────────────────────────────── */
/* ─────────────────────────────────────────────
   Fog overlay (CSS haze layers, drifting)
   Put this AFTER the base .wx-fx__particles rules
   ───────────────────────────────────────────── */

.wx-fx--fog .wx-fx__particles {
    position: absolute;
    inset: -25%;
    pointer-events: none;
    opacity: 1;
    filter: blur(1px);
    will-change: transform, background-position;
    transform: translate3d(0,0,0);
    background: radial-gradient(closest-side at 15% 40%, rgba(255,255,255,.26), rgba(255,255,255,0) 65%), radial-gradient(closest-side at 55% 50%, rgba(255,255,255,.20), rgba(255,255,255,0) 70%), radial-gradient(closest-side at 85% 35%, rgba(255,255,255,.22), rgba(255,255,255,0) 68%);
    background-size: 220% 220%;
    background-position: 0% 50%;
    animation: wx-fog-pan-1 14s ease-in-out infinite;
}

    .wx-fx--fog .wx-fx__particles::before,
    .wx-fx--fog .wx-fx__particles::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        will-change: transform, background-position;
        transform: translate3d(0,0,0);
    }

    /* thicker blobs */
    .wx-fx--fog .wx-fx__particles::before {
        opacity: .55;
        filter: blur(18px);
        background: radial-gradient(closest-side at 25% 60%, rgba(255,255,255,.30), rgba(255,255,255,0) 60%), radial-gradient(closest-side at 65% 45%, rgba(255,255,255,.26), rgba(255,255,255,0) 62%), radial-gradient(closest-side at 55% 80%, rgba(255,255,255,.20), rgba(255,255,255,0) 70%);
        background-size: 260% 260%;
        background-position: 100% 40%;
        animation: wx-fog-pan-2 18s ease-in-out infinite;
    }

    /* fine mist texture */
    .wx-fx--fog .wx-fx__particles::after {
        opacity: .18;
        filter: blur(10px);
        mix-blend-mode: screen;
        background: repeating-radial-gradient(circle at 30% 40%, rgba(255,255,255,.16) 0 1px, rgba(255,255,255,0) 1px 12px);
        background-size: 180% 180%;
        background-position: 0% 0%;
        animation: wx-fog-pan-3 9s ease-in-out infinite;
    }

/* Seamless loops: 0% and 100% match (no visible snap) */
@keyframes wx-fog-pan-1 {
    0% {
        transform: translate3d(-10%, -2%, 0) scale(1.03);
        background-position: 0% 50%;
    }

    50% {
        transform: translate3d( 10%, 2%, 0) scale(1.08);
        background-position: 100% 50%;
    }

    100% {
        transform: translate3d(-10%, -2%, 0) scale(1.03);
        background-position: 0% 50%;
    }
}

@keyframes wx-fog-pan-2 {
    0% {
        transform: translate3d( 12%, 2%, 0) scale(1.06);
        background-position: 100% 40%;
    }

    50% {
        transform: translate3d(-12%, -2%, 0) scale(1.10);
        background-position: 0% 60%;
    }

    100% {
        transform: translate3d( 12%, 2%, 0) scale(1.06);
        background-position: 100% 40%;
    }
}

@keyframes wx-fog-pan-3 {
    0% {
        transform: translate3d(0,0,0);
        background-position: 0% 0%;
    }

    50% {
        transform: translate3d(-6%, 3%,0);
        background-position: 100% 100%;
    }

    100% {
        transform: translate3d(0,0,0);
        background-position: 0% 0%;
    }
}


/* keep this while testing */
@media (prefers-reduced-motion: reduce) {
    .wx-fx--fog .wx-fx__particles,
    .wx-fx--fog .wx-fx__particles::before,
    .wx-fx--fog .wx-fx__particles::after {
        animation: none !important;
    }
}
