:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-panel: #1a2234;
    --bg-panel-hover: #1f2b42;
    --border: #2a3654;
    --text-primary: #e8edf5;
    --text-secondary: #8899b4;
    --text-muted: #5a6a85;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --panel-blur: blur(16px);
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:var(--font-sans); background:var(--bg-primary); color:var(--text-primary); overflow:hidden; height:100vh; }

/* Loading */
.loading-overlay { position:fixed; inset:0; background:var(--bg-primary); z-index:9999; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:20px; transition:opacity .5s ease; }
.loading-overlay.hidden { opacity:0; pointer-events:none; }
.loading-spinner { width:48px; height:48px; border:3px solid var(--border); border-top-color:var(--accent-cyan); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg) } }
.loading-text { font-family:var(--font-mono); font-size:14px; color:var(--text-secondary); }

/* Header */
.header { position:fixed; top:0; left:0; right:0; height:56px; background:linear-gradient(180deg,rgba(10,14,23,.97),rgba(10,14,23,.92)); backdrop-filter:blur(20px); border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; padding:0 20px; z-index:1000; }
.header-left,.header-right { display:flex; align-items:center; gap:12px; }
.header-center { display:flex; gap:4px; }
.logo { display:flex; align-items:center; gap:10px; }
.logo-icon { width:32px; height:32px; background:linear-gradient(135deg,var(--accent-cyan),var(--accent-blue)); border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:18px; }
.logo-text { font-family:var(--font-mono); font-weight:700; font-size:18px; letter-spacing:-.5px; background:linear-gradient(135deg,var(--accent-cyan),var(--accent-blue)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.nav-tab { padding:8px 16px; font-size:13px; font-weight:500; color:var(--text-secondary); background:transparent; border:none; border-radius:6px; cursor:pointer; transition:all var(--transition); font-family:var(--font-sans); }
.nav-tab:hover { color:var(--text-primary); background:var(--bg-panel); }
.nav-tab.active { color:var(--accent-cyan); background:rgba(6,182,212,.1); }

/* Search */
.search-box { position:relative; display:flex; align-items:center; background:var(--bg-panel); border:1px solid var(--border); border-radius:8px; padding:0 12px; height:36px; gap:8px; transition:border-color var(--transition); }
.search-box:focus-within { border-color:var(--accent-cyan); }
.search-box svg { width:16px; height:16px; color:var(--text-muted); flex-shrink:0; }
.search-box input { background:none; border:none; color:var(--text-primary); font-family:var(--font-sans); font-size:13px; width:200px; outline:none; }
.search-box input::placeholder { color:var(--text-muted); }
.search-results { position:absolute; top:42px; left:0; right:0; background:var(--bg-panel); border:1px solid var(--border); border-radius:8px; box-shadow:var(--shadow); display:none; overflow:hidden; z-index:100; }
.search-results.visible { display:block; }
.search-result-item { padding:10px 14px; cursor:pointer; font-size:13px; border-bottom:1px solid var(--border); transition:background var(--transition); }
.search-result-item:hover { background:var(--bg-panel-hover); }
.search-result-item:last-child { border-bottom:none; }
.search-result-sub { font-size:11px; color:var(--text-muted); margin-top:2px; }

.icon-btn { width:36px; height:36px; background:var(--bg-panel); border:1px solid var(--border); border-radius:8px; color:var(--text-secondary); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all var(--transition); }
.icon-btn:hover { border-color:var(--accent-cyan); color:var(--accent-cyan); }
.icon-btn svg { width:18px; height:18px; }

/* Map */
#map { position:fixed; top:56px; left:0; right:0; bottom:0; z-index:1; }

/* Side Panel */
.side-panel { position:fixed; top:68px; left:12px; width:320px; max-height:calc(100vh - 80px); overflow-y:auto; z-index:500; display:flex; flex-direction:column; gap:10px; padding-bottom:20px; }
.side-panel::-webkit-scrollbar { width:4px; }
.side-panel::-webkit-scrollbar-thumb { background:var(--border); border-radius:2px; }

.panel-card { background:rgba(26,34,52,.92); backdrop-filter:var(--panel-blur); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
.panel-header { padding:14px 16px 10px; display:flex; align-items:center; justify-content:space-between; }
.panel-title { font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.8px; color:var(--text-secondary); display:flex; align-items:center; gap:8px; }
.panel-meta { font-size:11px; color:var(--text-muted); }
.panel-body { padding:0 16px 14px; }

.dot { width:7px; height:7px; border-radius:50%; display:inline-block; }
.dot.pulse { animation:pulseDot 2s infinite; }
@keyframes pulseDot { 0%,100%{opacity:1} 50%{opacity:.4} }

/* Current Weather */
.current-weather { display:flex; align-items:center; justify-content:space-between; padding-bottom:12px; }
.temp-big { font-family:var(--font-mono); font-size:48px; font-weight:700; line-height:1; }
.temp-big .unit { font-size:20px; font-weight:400; color:var(--text-muted); vertical-align:super; }
.weather-desc { font-size:15px; font-weight:500; margin-top:4px; }
.weather-location { font-size:12px; color:var(--text-muted); margin-top:2px; }
.weather-icon { font-size:52px; line-height:1; }

.weather-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.weather-stat { background:var(--bg-secondary); border-radius:8px; padding:10px 12px; }
.stat-label { font-size:10px; text-transform:uppercase; letter-spacing:.6px; color:var(--text-muted); margin-bottom:4px; }
.stat-value { font-family:var(--font-mono); font-size:16px; font-weight:600; }
.stat-unit { font-size:11px; font-weight:400; color:var(--text-muted); }

.model-info { font-size:11px; color:var(--text-muted); padding:10px 0 0; border-top:1px solid rgba(42,54,84,.5); margin-top:8px; }
.model-badge { display:inline-flex; padding:2px 6px; background:rgba(139,92,246,.15); border:1px solid rgba(139,92,246,.3); border-radius:4px; font-family:var(--font-mono); font-size:10px; font-weight:600; color:var(--accent-purple); margin-right:4px; }

/* Hourly Forecast */
.hourly-scroll { display:flex; gap:6px; overflow-x:auto; padding:4px 0; scrollbar-width:none; }
.hourly-scroll::-webkit-scrollbar { display:none; }
.hour-item { display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 12px; background:var(--bg-secondary); border-radius:8px; min-width:60px; flex-shrink:0; }
.hour-item.now { background:rgba(6,182,212,.15); border:1px solid rgba(6,182,212,.3); }
.hour-time { font-size:11px; font-weight:500; color:var(--text-muted); }
.hour-icon { font-size:20px; }
.hour-temp { font-family:var(--font-mono); font-size:14px; font-weight:600; }
.hour-precip { font-size:10px; color:var(--accent-cyan); font-weight:500; }

/* Daily Forecast */
.daily-row { display:flex; align-items:center; padding:10px 0; border-bottom:1px solid rgba(42,54,84,.5); }
.daily-row:last-child { border-bottom:none; }
.daily-day { width:44px; font-size:13px; font-weight:500; }
.daily-icon { width:28px; font-size:18px; text-align:center; }
.daily-precip { width:40px; font-size:11px; color:var(--accent-cyan); text-align:center; }
.daily-temps { flex:1; display:flex; align-items:center; gap:8px; justify-content:flex-end; }
.daily-bar { flex:1; height:4px; background:var(--bg-secondary); border-radius:2px; position:relative; max-width:80px; }
.daily-bar-fill { position:absolute; height:100%; border-radius:2px; background:linear-gradient(90deg,var(--accent-cyan),var(--accent-amber)); }
.daily-lo,.daily-hi { font-family:var(--font-mono); font-size:13px; width:32px; text-align:right; }
.daily-lo { color:var(--text-muted); }
.daily-hi { font-weight:600; }

/* Layer Panel */
.layer-panel { position:fixed; top:68px; right:12px; z-index:500; display:flex; flex-direction:column; gap:10px; }
.layer-group { background:rgba(26,34,52,.92); backdrop-filter:var(--panel-blur); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
.layer-group-title { padding:10px 14px; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.8px; color:var(--text-muted); border-bottom:1px solid var(--border); }
.layer-option { display:flex; align-items:center; padding:10px 14px; gap:10px; cursor:pointer; transition:background var(--transition); border-bottom:1px solid rgba(42,54,84,.3); }
.layer-option:last-child { border-bottom:none; }
.layer-option:hover { background:var(--bg-panel-hover); }
.layer-toggle { width:34px; height:18px; background:var(--bg-secondary); border:1px solid var(--border); border-radius:10px; position:relative; transition:all var(--transition); flex-shrink:0; }
.layer-toggle::after { content:''; position:absolute; top:2px; left:2px; width:12px; height:12px; background:var(--text-muted); border-radius:50%; transition:all var(--transition); }
.layer-option.active .layer-toggle { background:rgba(6,182,212,.2); border-color:var(--accent-cyan); }
.layer-option.active .layer-toggle::after { left:18px; background:var(--accent-cyan); }
.layer-name { font-size:13px; font-weight:500; }
.layer-option.active .layer-name { color:var(--accent-cyan); }

/* Radar Controls */
.radar-controls { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); z-index:500; background:rgba(26,34,52,.94); backdrop-filter:var(--panel-blur); border:1px solid var(--border); border-radius:14px; padding:12px 20px; display:flex; align-items:center; gap:14px; box-shadow:var(--shadow); }
.ctrl-btn { width:36px; height:36px; background:var(--bg-secondary); border:1px solid var(--border); border-radius:8px; color:var(--text-primary); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all var(--transition); font-size:15px; }
.ctrl-btn:hover { background:var(--bg-panel-hover); border-color:var(--accent-cyan); }
.ctrl-btn.active { background:rgba(6,182,212,.2); border-color:var(--accent-cyan); color:var(--accent-cyan); }
.ctrl-divider { width:1px; height:24px; background:var(--border); }
.timeline-slider { flex:1; min-width:180px; height:6px; -webkit-appearance:none; appearance:none; background:var(--bg-secondary); border-radius:3px; outline:none; cursor:pointer; }
.timeline-slider::-webkit-slider-thumb { -webkit-appearance:none; width:16px; height:16px; background:var(--accent-cyan); border-radius:50%; border:2px solid var(--bg-panel); box-shadow:0 0 8px rgba(6,182,212,.5); cursor:pointer; }
.radar-time { font-family:var(--font-mono); font-size:14px; font-weight:600; min-width:130px; text-align:center; color:var(--accent-cyan); }
.opacity-ctrl { display:flex; align-items:center; gap:8px; }
.opacity-label { font-size:11px; color:var(--text-muted); white-space:nowrap; }
.opacity-slider { width:60px; height:4px; -webkit-appearance:none; appearance:none; background:var(--bg-secondary); border-radius:2px; outline:none; }
.opacity-slider::-webkit-slider-thumb { -webkit-appearance:none; width:12px; height:12px; background:var(--text-secondary); border-radius:50%; cursor:pointer; }

/* Radar Legend */
.radar-legend { position:fixed; bottom:80px; right:12px; z-index:500; background:rgba(26,34,52,.92); backdrop-filter:var(--panel-blur); border:1px solid var(--border); border-radius:var(--radius); padding:12px 14px; box-shadow:var(--shadow); }
.legend-title { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.6px; color:var(--text-muted); margin-bottom:8px; }
.legend-bar { height:12px; border-radius:3px; width:180px; background:linear-gradient(90deg,#00ff00 0%,#32cd32 15%,#ffff00 30%,#ffa500 45%,#ff4500 60%,#ff0000 75%,#8b0000 85%,#ff00ff 100%); margin-bottom:4px; }
.legend-labels { display:flex; justify-content:space-between; font-size:10px; color:var(--text-muted); font-family:var(--font-mono); }

/* Data Sources */
.data-sources { position:fixed; bottom:80px; left:12px; z-index:500; background:rgba(26,34,52,.88); backdrop-filter:var(--panel-blur); border:1px solid var(--border); border-radius:var(--radius); padding:10px 14px; box-shadow:var(--shadow); max-width:280px; }
.data-sources-title { font-size:10px; text-transform:uppercase; letter-spacing:.8px; color:var(--text-muted); margin-bottom:6px; }
.source-item { display:flex; align-items:center; gap:6px; font-size:11px; color:var(--text-secondary); margin:3px 0; font-family:var(--font-mono); }
.source-dot { width:5px; height:5px; border-radius:50%; flex-shrink:0; }

/* Leaflet overrides */
.leaflet-control-zoom a { background:var(--bg-panel)!important; color:var(--text-primary)!important; border-color:var(--border)!important; }
.leaflet-control-zoom a:hover { background:var(--bg-panel-hover)!important; }
.leaflet-control-attribution { background:rgba(10,14,23,.8)!important; color:var(--text-muted)!important; font-size:10px!important; }
.leaflet-control-attribution a { color:var(--text-secondary)!important; }
.leaflet-popup-content-wrapper { background:var(--bg-panel)!important; color:var(--text-primary)!important; border-radius:var(--radius)!important; border:1px solid var(--border)!important; box-shadow:var(--shadow)!important; }
.leaflet-popup-tip { background:var(--bg-panel)!important; }

.nexrad-marker { width:8px; height:8px; background:var(--accent-green); border:2px solid rgba(16,185,129,.3); border-radius:50%; box-shadow:0 0 8px rgba(16,185,129,.4); }
.station-popup h3 { font-family:var(--font-mono); font-weight:700; color:var(--accent-cyan); margin-bottom:4px; font-size:14px; }
.station-popup p { color:var(--text-secondary); margin:2px 0; font-size:12px; }

.mobile-toggle { display:none; }

/* Responsive */
@media (max-width:900px) {
    .side-panel { width:280px; left:8px; }
    .radar-controls { left:8px; right:8px; transform:none; padding:10px 14px; gap:10px; }
    .radar-time { min-width:100px; font-size:12px; }
    .search-box input { width:140px; }
}
@media (max-width:640px) {
    .side-panel { display:none; }
    .side-panel.open { display:flex; width:calc(100vw - 16px); left:8px; }
    .header-center { display:none; }
    .search-box input { width:100px; }
    .data-sources { display:none; }
    .mobile-toggle { display:flex!important; }
}
