@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: dark;
    --ink: #06111d;
    --panel: rgba(7, 19, 31, .94);
    --line: rgba(195, 218, 228, .16);
    --muted: #8fa3ad;
    --text: #f2f6f4;
    --acid: #caf442;
    --cyan: #41d4e7;
    font-family: Manrope, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--ink); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
h1:focus { outline: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { height: 100%; color: var(--text); background: var(--ink); }
.topbar { height: 74px; display: grid; grid-template-columns: minmax(230px, 1fr) minmax(300px, 600px) minmax(230px, 1fr); align-items: center; gap: 30px; padding: 0 24px; border-bottom: 1px solid var(--line); background: #081521; position: relative; z-index: 1001; }
.brand { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 12px; width: max-content; }
.brand-mark { width: 34px; height: 34px; position: relative; display: grid; place-items: center; border: 1px solid rgba(202,244,66,.55); border-radius: 50%; }
.brand-mark::before, .brand-mark::after { content: ''; position: absolute; background: var(--acid); opacity: .7; }
.brand-mark::before { width: 44px; height: 1px; }
.brand-mark::after { height: 44px; width: 1px; }
.brand-mark i { display: block; position: absolute; width: 3px; height: 3px; background: var(--acid); border-radius: 50%; }
.brand-mark i:nth-child(1) { transform: translate(-7px, 5px); }
.brand-mark i:nth-child(2) { transform: translate(6px, -7px); }
.brand-mark i:nth-child(3) { width: 7px; height: 7px; }
.brand strong { display: block; font-size: 13px; letter-spacing: .13em; line-height: 1.2; }
.brand small, .eyebrow { display: block; color: var(--muted); font: 500 9px/1.4 'DM Mono', monospace; letter-spacing: .13em; margin-top: 4px; }

.search-wrap { position: relative; width: 100%; }
.search { height: 43px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(195,218,228,.22); background: #0c1d2b; padding: 0 12px; transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: rgba(202,244,66,.75); box-shadow: 0 0 0 3px rgba(202,244,66,.08); }
.search svg { width: 17px; height: 17px; stroke: #9caeb7; fill: none; stroke-width: 1.7; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; color: #f7faf9; background: transparent; font-size: 13px; }
.search input::placeholder { color: #6e838e; }
.search kbd { border: 1px solid #314552; background: #132633; color: #91a3ad; border-radius: 3px; padding: 2px 7px; font: 10px 'DM Mono', monospace; }
.search-spinner, .mini-loader { width: 14px; height: 14px; border: 2px solid rgba(202,244,66,.25); border-top-color: var(--acid); border-radius: 50%; animation: spin .8s linear infinite; }
.search-results { position: absolute; top: calc(100% + 10px); left: 0; right: 0; max-height: min(440px, calc(100vh - 100px)); overflow-y: auto; background: rgba(8,21,33,.98); border: 1px solid rgba(195,218,228,.2); box-shadow: 0 24px 70px rgba(0,0,0,.45); z-index: 1200; }
.search-results button { width: 100%; min-height: 62px; padding: 10px 14px; border: 0; border-bottom: 1px solid rgba(195,218,228,.1); color: var(--text); background: transparent; display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; text-align: left; cursor: pointer; }
.search-results button:hover { background: rgba(202,244,66,.08); }
.search-results button strong { display: block; font-size: 13px; }
.search-results button small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.search-results button em { color: #718892; font: normal 9px 'DM Mono', monospace; }
.result-pin { width: 9px; height: 9px; border: 2px solid var(--acid); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.search-message { margin: 0; padding: 22px; color: #a8b7bd; font-size: 12px; text-align: center; }

.top-actions { justify-self: end; display: flex; align-items: center; gap: 18px; }
.live-status { font: 500 9px 'DM Mono', monospace; letter-spacing: .12em; color: #a1b2b9; white-space: nowrap; }
.live-status span { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 4px rgba(202,244,66,.1); animation: pulse 2s infinite; }
.unit-toggle { display: flex; padding: 3px; gap: 2px; border: 1px solid rgba(195,218,228,.18); background: #0c1d2b; color: #778c96; cursor: pointer; }
.unit-toggle span { padding: 7px 9px; font: 600 10px 'DM Mono', monospace; }
.unit-toggle .active { color: #07131e; background: var(--acid); }

.map-stage { position: relative; height: calc(100% - 74px); overflow: hidden; }
#world-map { position: absolute; inset: 0; background: #9cb1b7; }
#world-map::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 400; background: radial-gradient(circle at 44% 45%, transparent 15%, rgba(2,11,18,.2) 100%); box-shadow: inset 0 0 100px rgba(1,10,16,.35); }
.leaflet-tile-pane { filter: saturate(.55) contrast(1.05) brightness(.83) hue-rotate(150deg); }
.leaflet-control-zoom { margin: 0 0 56px 18px !important; border: 1px solid rgba(236,248,248,.38) !important; border-radius: 0 !important; box-shadow: 0 8px 25px rgba(0,0,0,.2) !important; }
.leaflet-control-zoom a { color: #d6e0df !important; background: rgba(8,25,36,.9) !important; border-color: rgba(236,248,248,.18) !important; }
.leaflet-control-attribution { display: none; }

.weather-marker-host { border: 0; background: transparent; }
.weather-marker { width: 48px; height: 32px; position: relative; display: grid; place-items: center; color: #05111b; background: #d7e3e4; border: 1px solid rgba(255,255,255,.75); border-radius: 17px; box-shadow: 0 5px 16px rgba(2,12,18,.3); font: 800 13px Manrope, sans-serif; transition: transform .15s, box-shadow .15s; }
.weather-marker::after { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(4,17,25,.14); border-radius: inherit; }
.weather-marker i { position: absolute; left: 50%; bottom: -6px; width: 8px; height: 8px; transform: translateX(-50%) rotate(45deg); background: inherit; border-right: 1px solid rgba(255,255,255,.75); border-bottom: 1px solid rgba(255,255,255,.75); }
.weather-marker span { position: relative; z-index: 1; }
.weather-marker-host:hover .weather-marker, .weather-marker.selected { transform: translateY(-3px) scale(1.08); box-shadow: 0 8px 25px rgba(2,12,18,.42); }
.weather-marker.selected { outline: 2px solid var(--acid); outline-offset: 3px; }
.weather-marker.temp-arctic { background: #4ca7ff; }
.weather-marker.temp-cold { background: #75d8ec; }
.weather-marker.temp-mild { background: #bce77a; }
.weather-marker.temp-warm { background: #f4e85e; }
.weather-marker.temp-hot { background: #ff9d46; }
.weather-marker.temp-extreme { background: #ff5364; color: #fff; }
.weather-marker.pending { background: #75878e; color: #eaf0ef; }
.city-tooltip { padding: 7px 10px !important; border: 0 !important; border-radius: 0 !important; background: #071722 !important; color: #f3f6f5 !important; box-shadow: 0 8px 22px rgba(0,0,0,.25) !important; }
.city-tooltip::before { border-top-color: #071722 !important; }
.city-tooltip strong { display: block; font-size: 11px; }
.city-tooltip span { display: block; color: #91a3aa; font-size: 9px; margin-top: 2px; }

.map-loading { position: absolute; inset: 0; z-index: 800; display: grid; place-content: center; justify-items: center; gap: 11px; background: #071521; }
.map-loading strong, .detail-loading strong { font: 600 11px 'DM Mono', monospace; letter-spacing: .14em; }
.map-loading small { color: var(--muted); font-size: 11px; }
.radar-loader { width: 58px; height: 58px; margin-bottom: 8px; border: 1px solid rgba(202,244,66,.35); border-radius: 50%; position: relative; background: repeating-radial-gradient(circle, transparent 0 9px, rgba(202,244,66,.11) 10px 11px); overflow: hidden; }
.radar-loader::after { content: ''; position: absolute; width: 50%; height: 50%; left: 50%; top: 0; transform-origin: 0 100%; background: linear-gradient(135deg, rgba(202,244,66,.55), transparent 65%); animation: radar 1.5s linear infinite; }

.map-readout { position: absolute; left: 22px; top: 22px; z-index: 500; height: 57px; display: flex; align-items: center; gap: 14px; padding: 0 16px 0 12px; background: rgba(7,23,34,.88); border: 1px solid rgba(224,238,238,.25); backdrop-filter: blur(10px); }
.map-readout .readout-cross { color: var(--acid); font-size: 18px; }
.map-readout div { min-width: 72px; }
.map-readout strong { display: block; font: 600 13px 'DM Mono', monospace; }
.map-readout small { display: block; margin-top: 4px; color: #82969f; font: 8px 'DM Mono', monospace; letter-spacing: .09em; }
.map-readout > i { height: 25px; width: 1px; background: rgba(205,223,225,.18); }
.temperature-legend { position: absolute; left: 182px; bottom: 22px; z-index: 500; display: flex; align-items: center; gap: 8px; color: #31434a; font: 700 8px 'DM Mono', monospace; letter-spacing: .08em; }
.temperature-legend i { display: block; width: 95px; height: 5px; background: linear-gradient(90deg,#4ca7ff,#75d8ec,#bce77a,#f4e85e,#ff9d46,#ff5364); }
.map-error { position: absolute; z-index: 700; left: 50%; bottom: 25px; transform: translateX(-50%); padding: 11px 15px; border: 1px solid rgba(255,165,76,.65); background: rgba(46,26,13,.93); color: #ffd2aa; font-size: 11px; cursor: pointer; }
.map-error strong { margin-left: 8px; color: #fff; text-decoration: underline; }

.weather-panel { position: absolute; z-index: 700; top: 0; right: 0; width: 390px; height: 100%; border-left: 1px solid rgba(205,223,225,.18); background: var(--panel); backdrop-filter: blur(18px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #314a55 transparent; }
.panel-empty { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 48px; background: radial-gradient(circle at 50% 31%, rgba(65,212,231,.08), transparent 32%); }
.coordinate-icon { width: 67px; height: 67px; display: grid; place-items: center; margin-bottom: 31px; border: 1px solid rgba(202,244,66,.35); border-radius: 50%; position: relative; }
.coordinate-icon::before, .coordinate-icon::after { content: ''; position: absolute; background: rgba(202,244,66,.55); }
.coordinate-icon::before { width: 85px; height: 1px; }
.coordinate-icon::after { width: 1px; height: 85px; }
.coordinate-icon i { width: 11px; height: 11px; border: 2px solid var(--acid); border-radius: 50%; box-shadow: 0 0 0 5px rgba(202,244,66,.08); }
.panel-empty h1 { font-size: 30px; line-height: 1.12; letter-spacing: -.035em; margin: 13px 0 17px; }
.panel-empty > p:not(.eyebrow) { max-width: 260px; color: #9aadb5; font-size: 13px; line-height: 1.75; }
.empty-rule { display: flex; align-items: center; gap: 12px; margin-top: 31px; color: #6f8791; font: 9px 'DM Mono', monospace; letter-spacing: .1em; }
.empty-rule i { width: 54px; height: 1px; background: var(--acid); }
.panel-close { position: absolute; right: 17px; top: 17px; z-index: 2; width: 33px; height: 33px; border: 1px solid rgba(205,223,225,.18); background: rgba(10,28,40,.8); color: #aab9be; font-size: 22px; line-height: 1; cursor: pointer; }
.panel-heading { padding: 34px 32px 23px; border-bottom: 1px solid var(--line); background: linear-gradient(160deg, rgba(65,212,231,.08), transparent 45%); }
.panel-heading h1 { margin: 7px 0 4px; padding-right: 35px; font-size: 28px; letter-spacing: -.035em; }
.panel-heading > p:last-child { margin: 0; color: #8ea1a9; font: 9px 'DM Mono', monospace; letter-spacing: .05em; }
.detail-loading, .detail-error { min-height: 430px; display: flex; flex-direction: column; place-content: center; align-items: center; gap: 15px; padding: 30px; color: #9aabb2; text-align: center; }
.detail-error button { border: 1px solid var(--acid); background: transparent; color: var(--acid); padding: 9px 15px; cursor: pointer; }
.current-hero { min-height: 170px; display: grid; grid-template-columns: 118px 1fr; align-items: center; gap: 14px; padding: 16px 30px; border-bottom: 1px solid var(--line); }
.condition-symbol { width: 96px; height: 96px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(244,232,94,.18), transparent 62%); }
.condition-symbol span { font-size: 62px; line-height: 1; color: #f6df58; filter: drop-shadow(0 0 18px rgba(246,223,88,.2)); }
.condition-symbol.cloudy span { color: #9ed7dd; }
.condition-symbol.wet span { color: #67c9f0; }
.condition-symbol.night span { color: #c5d0ff; }
.hero-temp { display: block; font-size: 60px; font-weight: 500; line-height: .9; letter-spacing: -.07em; }
.current-hero p { margin: 12px 0 3px; font-weight: 600; font-size: 13px; }
.current-hero small { color: #8da0a8; font-size: 11px; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.metrics > div { min-height: 91px; padding: 17px 22px; position: relative; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metrics > div:nth-child(even) { border-right: 0; }
.metrics > div:nth-last-child(-n+2) { border-bottom: 0; }
.metrics span, .sun-times span { display: block; color: #748b95; font: 8px 'DM Mono', monospace; letter-spacing: .12em; }
.metrics strong { display: block; margin-top: 10px; font: 500 22px 'DM Mono', monospace; }
.metrics strong small { font-size: 10px; color: #93a5ac; }
.metrics em { position: absolute; right: 18px; bottom: 22px; color: var(--acid); font: normal 9px 'DM Mono', monospace; }
.forecast { padding: 22px 27px 14px; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; color: #8fa1a8; font: 500 8px 'DM Mono', monospace; letter-spacing: .13em; }
.section-title i { flex: 1; height: 1px; background: var(--line); }
.forecast-row { height: 39px; display: grid; grid-template-columns: 64px 36px 1fr 35px 35px; align-items: center; border-bottom: 1px solid rgba(195,218,228,.08); font-size: 11px; }
.forecast-row:last-child { border-bottom: 0; }
.forecast-row time { font: 500 9px 'DM Mono', monospace; }
.forecast-condition { font-size: 17px; color: #d9eaa1; text-align: center; }
.forecast-row .rain { color: #62c8e7; font: 9px 'DM Mono', monospace; text-align: center; }
.forecast-row strong, .forecast-row em { text-align: right; font: 600 11px 'DM Mono', monospace; }
.forecast-row em { color: #778d96; }
.sun-times { height: 72px; display: flex; align-items: center; justify-content: space-around; padding: 0 25px; }
.sun-times div { text-align: center; }
.sun-times strong { display: block; margin-top: 5px; font: 500 14px 'DM Mono', monospace; }
.sun-times > i { height: 29px; width: 1px; background: var(--line); }
.observation-time { padding: 0 25px 24px; margin: 0; color: #607781; text-align: center; font: 8px/1.5 'DM Mono', monospace; }
.data-credit { position: absolute; z-index: 500; left: 20px; bottom: 8px; color: rgba(19,39,47,.75); font: 700 7px 'DM Mono', monospace; letter-spacing: .07em; }
.data-credit a { color: inherit; }
.data-credit span { margin: 0 5px; }
.not-found { min-height: 100%; padding: 12vw; color: var(--text); background: #071521; }
.not-found h1 { font-size: clamp(38px, 7vw, 90px); }
.not-found a { color: var(--acid); }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000; padding: 12px 20px; background: #8c2632; color: #fff; }
#blazor-error-ui .dismiss { position: absolute; right: 12px; cursor: pointer; }
.loading-progress { position: absolute; width: 70px; height: 70px; inset: 30vh 0 auto; margin: auto; }
.loading-progress circle { fill: none; stroke: #263d49; stroke-width: .55rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--acid); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%; }
.loading-progress-text { position: absolute; inset: calc(30vh + 28px) 0 auto; text-align: center; font: 9px 'DM Mono', monospace; }
.loading-progress-text::after { content: var(--blazor-load-percentage-text, 'LOADING'); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(202,244,66,0); } }
@keyframes radar { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .topbar { grid-template-columns: auto 1fr auto; gap: 16px; }
    .brand small, .live-status { display: none; }
    .weather-panel { width: 350px; }
}

@media (max-width: 680px) {
    .topbar { height: 116px; grid-template-columns: 1fr auto; grid-template-rows: 56px 48px; padding: 0 14px 10px; gap: 0 12px; }
    .brand { grid-column: 1; grid-row: 1; }
    .brand-mark { width: 28px; height: 28px; }
    .brand strong { font-size: 11px; }
    .top-actions { grid-column: 2; grid-row: 1; }
    .search-wrap { grid-column: 1 / -1; grid-row: 2; }
    .map-stage { height: calc(100% - 116px); }
    .weather-panel { top: auto; bottom: 0; width: 100%; height: min(62%, 590px); border-left: 0; border-top: 1px solid rgba(205,223,225,.2); transform: translateY(calc(100% - 145px)); transition: transform .28s ease; }
    .weather-panel.open { transform: translateY(0); }
    .panel-empty { min-height: 145px; height: 145px; padding: 24px 28px; display: block; }
    .panel-empty .coordinate-icon, .panel-empty > p:not(.eyebrow), .empty-rule { display: none; }
    .panel-empty h1 { margin: 6px 0; font-size: 20px; }
    .panel-heading { padding: 23px 25px 18px; }
    .current-hero { min-height: 140px; grid-template-columns: 95px 1fr; }
    .condition-symbol { width: 78px; height: 78px; }
    .condition-symbol span { font-size: 50px; }
    .hero-temp { font-size: 50px; }
    .map-readout { left: 12px; top: 12px; transform: scale(.9); transform-origin: top left; }
    .temperature-legend { left: 12px; bottom: 157px; }
    .leaflet-control-zoom { margin-bottom: 195px !important; }
    .data-credit { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
