/* Weermodal: actuele KNMI-weerkaart en weerkaarten (dashboardkaart "Actueel weer"). */

.wx-overlay { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 24px;
              background: rgba(15, 23, 42, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
              opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s; }
.wx-overlay.open { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.wx-modal { --wx-surface: #fff; --wx-line: #e2e8f0; --wx-text: #0f172a; --wx-muted: #64748b; --wx-accent: #0b2a55;
            position: relative; width: min(980px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
            background: var(--wx-surface); color: var(--wx-text); border-radius: 20px; overflow: hidden;
            box-shadow: 0 30px 80px rgba(15, 23, 42, .35); transform: translateY(16px) scale(.97); opacity: 0;
            transition: transform .35s cubic-bezier(.2, .9, .3, 1.1), opacity .25s ease; }
.wx-overlay.open .wx-modal { transform: none; opacity: 1; }
[data-theme="dark"] .wx-modal { --wx-surface: #111827; --wx-line: #1f2937; --wx-text: #e5e7eb; --wx-muted: #94a3b8; --wx-accent: #3b82f6; }

.wx-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px 14px; }
.wx-head-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff;
              background: linear-gradient(135deg, #0ea5e9, #0b2a55); box-shadow: 0 6px 16px rgba(14, 165, 233, .35); flex: 0 0 auto; }
.wx-head-ic svg, .wx-ic { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wx-title { flex: 1; min-width: 0; }
.wx-title h3 { margin: 0; font-size: 1.15rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.wx-title small { color: var(--wx-muted); font-size: .8rem; }
.wx-live { width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: wx-live 2s ease-out infinite; }
.wx-iconbtn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--wx-line);
              background: var(--wx-surface); color: var(--wx-text); cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.wx-iconbtn:hover { transform: translateY(-1px); border-color: var(--wx-accent); }
.wx-iconbtn.is-spinning svg { animation: wx-spin .8s linear infinite; }

.wx-seg { position: relative; display: inline-flex; gap: 4px; margin: 0 22px; padding: 4px; border-radius: 12px; background: color-mix(in srgb, var(--wx-line) 70%, transparent); align-self: flex-start; }
.wx-seg button { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--wx-muted);
                 font: inherit; font-size: .86rem; font-weight: 600; padding: 8px 16px; border-radius: 9px; cursor: pointer; transition: color .2s; }
.wx-seg button svg { width: 16px; height: 16px; }
.wx-seg button.is-active { color: var(--wx-text); }
.wx-seg-pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 9px; background: var(--wx-surface);
               box-shadow: 0 2px 8px rgba(15, 23, 42, .12); transition: transform .3s cubic-bezier(.2, .9, .3, 1), width .3s cubic-bezier(.2, .9, .3, 1); }

.wx-body { position: relative; flex: 1; overflow-y: auto; padding: 16px 22px 8px; scrollbar-width: thin; }
.wx-panel { animation: wx-in .35s cubic-bezier(.2, .8, .2, 1) both; }
.wx-panel[hidden] { display: none; }
.wx-caption { margin: 0 0 12px; font-size: .84rem; color: var(--wx-muted); }

.wx-frame { position: relative; border-radius: 16px; overflow: hidden; background: #e2e8f0; border: 1px solid var(--wx-line); }
.wx-frame.is-main { aspect-ratio: 1 / 1; width: min(100%, max(300px, calc(100vh - 300px))); margin: 0 auto; }
.wx-frame img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; opacity: 0; transform: scale(1.01);
                transition: opacity .45s ease, transform .6s ease; }
.wx-frame.is-loaded img { opacity: 1; transform: none; }
.wx-frame::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
                    background-size: 200% 100%; animation: wx-shimmer 1.2s infinite; transition: opacity .3s; }
.wx-frame.is-loaded::before, .wx-frame.is-error::before { opacity: 0; animation: none; }
.wx-frame-error { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
                  color: var(--wx-muted); font-size: .85rem; text-align: center; padding: 16px; }
.wx-frame.is-error .wx-frame-error { display: flex; }
.wx-frame-error button { border: 1px solid var(--wx-line); background: var(--wx-surface); color: var(--wx-text); border-radius: 9px; padding: 6px 12px; cursor: pointer; font: inherit; }

.wx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.wx-card { display: flex; flex-direction: column; border: 1px solid var(--wx-line); border-radius: 16px; overflow: hidden; background: var(--wx-surface);
           cursor: zoom-in; transition: transform .2s ease, box-shadow .2s ease; animation: wx-in .4s cubic-bezier(.2, .8, .2, 1) both; text-align: left; padding: 0; font: inherit; color: inherit; }
.wx-card:nth-child(2) { animation-delay: .04s; } .wx-card:nth-child(3) { animation-delay: .08s; } .wx-card:nth-child(4) { animation-delay: .12s; }
.wx-card:nth-child(5) { animation-delay: .16s; } .wx-card:nth-child(6) { animation-delay: .2s; }
.wx-card:hover, .wx-card:focus-visible { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15, 23, 42, .14); outline: none; }
.wx-card:focus-visible { box-shadow: 0 0 0 2px #0ea5e9, 0 14px 34px rgba(15, 23, 42, .14); }
.wx-card .wx-frame { border: 0; border-radius: 0; aspect-ratio: 4 / 3; }
.wx-card:hover .wx-frame img { transform: scale(1.03); }
.wx-card-text { padding: 10px 14px 12px; }
.wx-card-text strong { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.wx-card-text span { display: block; font-size: .76rem; color: var(--wx-muted); margin-top: 2px; }
.wx-tag { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; color: #0369a1; background: rgba(14, 165, 233, .14); }
.wx-tag.is-warn { color: #b45309; background: rgba(245, 158, 11, .16); }

.wx-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 22px 16px;
           border-top: 1px solid var(--wx-line); font-size: .76rem; color: var(--wx-muted); }
.wx-foot a { color: var(--wx-accent); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.wx-foot a:hover { text-decoration: underline; }

.wx-lightbox { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: color-mix(in srgb, var(--wx-surface) 96%, transparent);
               backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: wx-fade .2s ease both; }
.wx-lightbox[hidden] { display: none; }
.wx-lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; }
.wx-lightbox-head strong { font-size: 1rem; }
.wx-lightbox .wx-frame { flex: 1; margin: 0 22px 22px; animation: wx-zoom .3s cubic-bezier(.2, .9, .3, 1.1) both; }

.dash-weather-card { display: flex; flex-direction: column; gap: 10px; }
.dash-weather-card .card-header h3 { margin: 0; }
.wx-tile-map { position: relative; border-radius: 14px; overflow: hidden; background: #e2e8f0; aspect-ratio: 4 / 3; }
.wx-tile-map::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
                       background-size: 200% 100%; animation: wx-shimmer 1.2s infinite; }
.wx-tile-map img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%;
                   opacity: 0; transition: opacity .5s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.wx-tile-map.is-loaded img { opacity: 1; }
.wx-tile-map.is-loaded::before { animation: none; opacity: 0; }
.dash-weather-card:hover .wx-tile-map img { transform: scale(1.05); }
.wx-tile-badge { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
                 font-size: .72rem; font-weight: 600; color: #fff; background: rgba(15, 23, 42, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.wx-tile-badge i { width: 7px; height: 7px; border-radius: 50%; background: #10b981; animation: wx-live 2s ease-out infinite; }
.wx-tile-cta { position: absolute; right: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; color: #0b2a55;
               background: rgba(255, 255, 255, .9); opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.dash-weather-card:hover .wx-tile-cta, .dash-weather-card:focus-visible .wx-tile-cta { opacity: 1; transform: none; }

@keyframes wx-live { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); } 100% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); } }
@keyframes wx-spin { to { transform: rotate(360deg); } }
@keyframes wx-shimmer { to { background-position: -200% 0; } }
@keyframes wx-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes wx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wx-zoom { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
    .wx-overlay { padding: 0; }
    .wx-modal { max-height: 100vh; height: 100%; border-radius: 0; }
    .wx-seg { margin: 0 14px; } .wx-head, .wx-body, .wx-foot { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .wx-overlay, .wx-modal, .wx-panel, .wx-card, .wx-frame img, .wx-seg-pill, .wx-lightbox, .wx-lightbox .wx-frame, .wx-live,
    .wx-tile-map img, .wx-tile-map::before, .wx-tile-badge i, .wx-tile-cta { animation: none !important; transition: none !important; }
}
