/* ============================================
   Wetterdienst Eulenthal - Official Weather Service
   Fürstentum Eulenthal · Meteorologische Landesanstalt
   ============================================ */

/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

/* CSS Variables - Government/Institutional Color Scheme */
:root {
    /* Primary Colors - Red Government Palette */
    --color-primary: #BD3E3E;
    --color-primary-dark: #a03535;
    --color-primary-light: #d46b6b;
    --color-secondary: #1e2d3d;
    --color-secondary-dark: #141f2b;
    --color-secondary-light: #2d4456;
    
    /* Background Colors */
    --color-bg-light: #f4f4f2;
    --color-bg-white: #ffffff;
    --color-bg-card: #fafaf9;
    --color-bg-map: #e8e6df;
    
    /* Text Colors */
    --color-text: #1a1a1a;
    --color-text-secondary: #4a4a4a;
    --color-text-muted: #7a7a7a;
    --color-text-light: #ffffff;
    
    /* Border Colors */
    --color-border: #d9d9d4;
    --color-border-light: #ececea;
    
    /* Weather Colors */
    --color-sunny: #f5c842;
    --color-cloudy: #94a3b8;
    --color-rain: #3b82f6;
    --color-snow: #e0f2fe;
    --color-storm: #1e40af;
    
    /* Temperature Gradient */
    --temp-cold: #3b82f6;
    --temp-cool: #22d3ee;
    --temp-mild: #84cc16;
    --temp-warm: #f59e0b;
    --temp-hot: #ef4444;
    
    /* Fonts */
    --font-primary: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Fira Code', 'Consolas', monospace;
    
    /* Spacing */
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 10px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition: 0.2s ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: #ffffff;
    color: var(--color-text);
    line-height: 1.5;
    font-size: 15px;
    min-height: 100vh;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   TOP ACCENT BAR (thin red line above header)
   ============================================ */
.top-accent {
    height: 2px;
    background: var(--color-primary);
    flex-shrink: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   HEADER - Clean institutional style
   ============================================ */
.header {
    background: transparent;
    color: var(--color-text-light);
    padding: 0;
    position: relative;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.65rem 1rem;
    background: var(--color-secondary);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.coat-of-arms {
    font-size: 1.8rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.brand-subtitle {
    font-size: 0.74rem;
    font-weight: 400;
    opacity: 0.58;
    letter-spacing: 0.2px;
    display: none;
}

.header-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    padding: 0.42rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    position: relative;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.12);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.page-shell {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   VIEW TABS - GeoSphere-inspired underline tabs
   ============================================ */
.view-tabs {
    display: flex;
    background: var(--color-bg-white);
    border-bottom: 2px solid var(--color-border);
    padding: 0 0.5rem;
}

.view-tab {
    padding: 0.7rem 1rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.view-tab:hover {
    color: var(--color-text);
}

.view-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.view-tab.active::after {
    display: none;
}

/* Content Area */
.content-area {
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.content-area.hidden {
    display: none;
}

/* ============================================
   MAP AREA
   ============================================ */
.map-wrapper {
    position: relative;
    background: var(--color-bg-map);
    overflow: hidden;
    height: clamp(430px, 88vh, 1050px);
    min-height: 430px;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e8e6df;
}

/* Map Viewport & Content */
.map-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    position: relative;
}

.map-content {
    position: absolute;
    transform-origin: 0 0;
    will-change: transform;
}

.map-image {
    display: block;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}

.markers-container,
.coord-marker-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.markers-container .weather-marker {
    pointer-events: auto;
}

/* Map Controls */
.map-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 1000;
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.map-control-btn {
    width: 36px;
    height: 36px;
    background: var(--color-bg-white);
    border: none;
    color: var(--color-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.map-control-btn:hover {
    background: var(--color-primary);
    color: white;
}

.map-control-btn:not(:last-child) {
    border-bottom: 1px solid var(--color-border-light);
}

/* ============================================
   OVERLAY CANVASES
   ============================================ */
.overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 1;
    mix-blend-mode: normal;
}

#tempCanvas {
    z-index: 1;
}

#cloudCanvas {
    z-index: 2;
}

#weatherCanvas {
    z-index: 3;
}

#windCanvas {
    z-index: 4;
}

#pressureCanvas {
    z-index: 5;
}

#frontCanvas {
    z-index: 6;
}

/* ============================================
   LAYER BUTTONS (inline in animation bar)
   ============================================ */
.layer-separator {
    width: 1px;
    height: 20px;
    background: var(--color-border);
    margin: 0 4px;
}

.layer-btn {
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-white);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.5;
    line-height: 1;
}

.layer-btn:hover {
    opacity: 0.8;
    border-color: var(--color-primary);
}

.layer-btn.active {
    opacity: 1;
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 6px rgba(var(--color-primary-rgb, 59, 130, 246), 0.4);
}

/* ============================================
   TEMPERATURE LEGEND
   ============================================ */
.temp-legend {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 0.6rem 0.8rem;
    z-index: 1000;
    display: none;
}

.legend-gradient {
    width: 180px;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(
        to right,
        rgb(48, 0, 168),
        rgb(0, 100, 255),
        rgb(0, 200, 200),
        rgb(0, 180, 80),
        rgb(150, 200, 0),
        rgb(255, 220, 0),
        rgb(255, 150, 0),
        rgb(255, 80, 0),
        rgb(180, 0, 50)
    );
    margin-bottom: 0.4rem;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
}

.legend-labels span {
    text-align: center;
}

/* ============================================
   WEATHER MARKERS - GeoSphere-inspired compact labels
   ============================================ */
.weather-marker {
    position: absolute;
    transform: translate(-50%, -100%);
    cursor: pointer;
    z-index: 10;
    transition: transform var(--transition), z-index 0s;
}

.weather-marker:hover {
    transform: translate(-50%, -100%) scale(1.08);
    z-index: 20;
}

.weather-marker.selected {
    z-index: 25;
    transform: translate(-50%, -100%) scale(1.08);
}

.marker-content {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--color-secondary);
    color: white;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    position: relative;
}

.marker-content::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--color-secondary);
}

.weather-marker.selected .marker-content {
    background: var(--color-primary);
}

.weather-marker.selected .marker-content::after {
    border-top-color: var(--color-primary);
}

.marker-weather-icon {
    font-size: 1.1rem;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
}

.marker-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

.marker-temp-high {
    font-weight: 700;
    margin-left: 0.15rem;
}

.marker-temp-low {
    opacity: 0.65;
    font-weight: 500;
}

/* ============================================
   DAY NAVIGATION
   ============================================ */
.day-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-bg-white);
    border-top: 1px solid var(--color-border);
    padding: 0;
}

.day-tabs {
    display: flex;
    flex: 1;
}

.day-tab {
    padding: 0.75rem 1.25rem;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    border-right: 1px solid var(--color-border-light);
}

.day-tab:hover {
    background: var(--color-bg-light);
    color: var(--color-text);
}

.day-tab.active {
    background: var(--color-primary);
    color: white;
}

.current-datetime {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    border-left: 1px solid var(--color-border);
}

/* ============================================
   STATION DETAIL OVERLAY
   ============================================ */
.station-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 440px;
    max-width: calc(100% - 2rem);
    max-height: calc(100% - 2rem);
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border-radius: 16px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 10px 20px -2px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 2000;
    overflow: hidden;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.station-overlay.visible {
    display: flex;
    animation: overlaySlideIn 0.25s ease-out;
}

@keyframes overlaySlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.overlay-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 300;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.overlay-close:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.overlay-content {
    overflow-y: auto;
    max-height: 85vh;
}

/* Station Header */
.station-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--color-secondary) 0%, #1e3a5f 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.station-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.station-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.station-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
}

.station-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.station-header > .station-meta {
    margin-top: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

.station-current {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.current-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.current-details {
    display: flex;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: var(--color-text);
}

.current-temp {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    letter-spacing: -2px;
}

.current-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.current-info span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}

/* Weekly Forecast */
.weekly-forecast {
    display: flex;
    background: #fafafa;
    overflow-x: auto;
    scrollbar-width: none;
}

.weekly-forecast::-webkit-scrollbar {
    display: none;
}

.forecast-day {
    flex: 1;
    min-width: 54px;
    padding: 0.85rem 0.4rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.forecast-day:first-child {
    background: rgba(138, 154, 91, 0.1);
}

.forecast-day:hover {
    background: rgba(138, 154, 91, 0.08);
}

.forecast-day-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.forecast-day:first-child .forecast-day-name {
    color: var(--color-primary-dark);
}

.forecast-day-icon {
    font-size: 1.35rem;
    margin: 0.35rem 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.forecast-day-temps {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.forecast-temp-high {
    color: #1f2937;
}

.forecast-temp-low {
    color: #9ca3af;
    font-weight: 500;
}

.forecast-day-precip {
    font-size: 0.65rem;
    color: #3b82f6;
    margin-top: 0.35rem;
    min-height: 1em;
    font-weight: 500;
}

/* Detailed Forecast Section */
.detail-forecast {
    padding: 1rem 1rem 0.75rem;
    background: white;
}

.detail-forecast-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-forecast-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--color-primary);
    border-radius: 2px;
}

/* Hourly Scroll Container */
.hourly-scroll-container {
    overflow-x: auto;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
    scrollbar-width: none;
}

.hourly-scroll-container::-webkit-scrollbar {
    display: none;
}

.hourly-grid {
    display: flex;
    flex-direction: column;
    min-width: max-content;
}

.hourly-row {
    display: flex;
    gap: 0;
}

/* Hourly Time Labels */
.hourly-times {
    margin-bottom: 0.25rem;
}

.hourly-time {
    width: 28px;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
}

/* Hourly Icons Row */
.hourly-icons {
    margin-bottom: 0.35rem;
}

.hourly-item {
    width: 28px;
    text-align: center;
}

.hourly-icon {
    font-size: 1rem;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

/* Wind Row */
.hourly-winds {
    padding: 0.4rem 0;
    margin-bottom: 0.5rem;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    background: #fafafa;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.wind-item {
    width: 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.wind-arrow {
    font-size: 0.7rem;
    color: #64748b;
}

.wind-speed {
    font-size: 0.6rem;
    color: #94a3b8;
    font-weight: 600;
}

/* Temperature Chart */
.temp-chart-container {
    position: relative;
    height: 140px;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

.chart-y-axis {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 30px;
    width: 35px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-align: right;
    padding-right: 5px;
}

.chart-area {
    position: absolute;
    left: 35px;
    right: 35px;
    top: 0;
    bottom: 30px;
}

.chart-y-axis-right {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 30px;
    width: 35px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--color-rain);
    text-align: left;
    padding-left: 5px;
}

.chart-x-axis {
    position: absolute;
    left: 35px;
    right: 35px;
    bottom: 0;
    height: 30px;
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border-light);
    padding-top: 5px;
}

.chart-x-label {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.chart-x-day {
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* Station Weather Grid */
.weather-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: #e5e7eb;
    border-top: 1px solid #e5e7eb;
}

.weather-grid-item {
    background: white;
    padding: 0.85rem 0.75rem;
    text-align: center;
    transition: background 0.2s ease;
}

.weather-grid-item:hover {
    background: #fafafa;
}

.weather-grid-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.35rem;
}

.weather-grid-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.15rem;
}

.weather-grid-value .unit {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
}

/* ============================================
   TABLE VIEW
   ============================================ */
.table-container {
    flex: 1;
    overflow: auto;
    padding: 1rem;
}

.weather-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.weather-table thead {
    background: var(--color-secondary);
    color: white;
}

.weather-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.weather-table tbody tr {
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition);
    cursor: pointer;
}

.weather-table tbody tr:hover {
    background: var(--color-bg-light);
}

.weather-table tbody tr:last-child {
    border-bottom: none;
}

.weather-table td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.table-station-name {
    font-weight: 600;
    color: var(--color-text);
}

.table-weather-icon {
    font-size: 1.3rem;
}

.table-temp {
    font-weight: 600;
    font-family: var(--font-mono);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: transparent;
    border-top: none;
    padding: 0.75rem 0 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.8rem;
    background: var(--color-secondary);
    border-top: 2px solid var(--color-primary);
    padding: 0.75rem 1rem;
}

.footer-left,
.footer-center,
.footer-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-status::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    flex-shrink: 0;
}

.footer-rss-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--transition);
}

.footer-rss-link:hover {
    color: #fff;
}

.footer-copyright {
    opacity: 0.6;
}

/* ============================================
   COORDINATE PICKER PANEL (Admin)
   ============================================ */
.coord-picker-panel {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    width: 320px;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    overflow: hidden;
}

.coord-picker-panel.hidden {
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--color-secondary);
    color: white;
}

.panel-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
}

.panel-toggle {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.panel-content {
    padding: 1rem;
}

.panel-instruction {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    text-align: center;
    padding: 0.5rem;
    background: var(--color-bg-light);
    border-radius: var(--radius-sm);
}

.coord-display {
    margin-bottom: 1rem;
}

.coord-group {
    background: var(--color-bg-light);
    padding: 0.75rem;
    border-radius: var(--radius-md);
}

.coord-group label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.coord-values {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coord-label {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
}

.coord-values input {
    flex: 1;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text);
    width: 80px;
}

.coord-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.copy-output textarea {
    width: 100%;
    height: 60px;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    resize: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-small {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    background: var(--color-primary);
    color: white;
    border: 1px solid var(--color-primary-dark);
}

.btn-small:hover {
    background: var(--color-primary-dark);
}

/* Collapsed panel state */
.coord-picker-panel.collapsed .panel-content {
    display: none;
}

/* Coordinate marker */
.coord-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    background: var(--color-primary);
    border: 2px solid white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    box-shadow: var(--shadow-sm);
    z-index: 5;
}

/* ============================================
   LOADING & STATUS STATES
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--color-text-secondary);
}

.loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .station-overlay {
        width: 380px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    
    .header-nav {
        width: 100%;
        justify-content: flex-start;
    }
    
    .brand-subtitle {
        display: none;
    }
    
    .view-tabs {
        width: 100%;
        padding: 0;
    }
    
    .view-tab {
        flex: 1;
        text-align: center;
        font-size: 0.92rem;
    }
    
    .station-overlay {
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        max-width: 100%;
        max-height: 60vh;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
    
    .day-navigation {
        flex-direction: column;
    }
    
    .day-tabs {
        overflow-x: auto;
        width: 100%;
    }
    
    .day-tab {
        flex: 0 0 auto;
        padding: 0.75rem 1rem;
    }
    
    .current-datetime {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--color-border);
        text-align: center;
    }
    
    .map-controls {
        bottom: 0.5rem;
        right: 0.5rem;
    }
}

@media (max-width: 480px) {
    .brand-title {
        font-size: 1.1rem;
    }
    
    .coat-of-arms {
        font-size: 2rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .station-header {
        padding: 1rem;
    }
    
    .station-name {
        font-size: 1.2rem;
    }
    
    .current-temp {
        font-size: 1.75rem;
    }
    
    .forecast-day {
        min-width: 60px;
        padding: 0.5rem 0.25rem;
    }
    
    .weather-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-container {
        padding: 0.5rem;
    }
    
    .weather-table th,
    .weather-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   DAY BAR - Dark horizontal day selector
   ============================================ */
.day-bar {
    display: flex;
    align-items: stretch;
    background: var(--color-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.day-selector {
    display: flex;
    gap: 0;
    flex: 1;
    overflow-x: auto;
}

.day-btn {
    padding: 0.62rem 1rem;
    border: none;
    background: transparent;
    font-family: var(--font-primary);
    font-size: 0.92rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
}

.day-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.day-btn.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid var(--color-primary);
}

.day-bar-datetime {
    display: flex;
    align-items: center;
    padding: 0 0.9rem;
    font-family: var(--font-primary);
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.regime-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.9);
    vertical-align: middle;
}

/* ============================================
   ANIMATION CONTROLS
   ============================================ */
.animation-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 0.75rem;
    background: var(--color-bg-white);
    border-bottom: 1px solid var(--color-border);
}

.anim-btn {
    padding: 5px 12px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-white);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.anim-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.anim-btn.hidden {
    display: none;
}

.hour-slider {
    width: 200px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--color-border);
    border-radius: 3px;
    cursor: pointer;
}

.hour-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
}

.hour-display {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    min-width: 50px;
}

/* ============================================
   SEVERE BANNER (top of page for level 3-4)
   ============================================ */
.severe-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    max-width: 1200px;
    margin: 0 auto;
}

.severe-banner.hidden {
    display: none;
}

.severe-banner--severe {
    background: #ea580c;
    color: #fff;
}

.severe-banner--severe:hover {
    background: #c2410c;
}

.severe-banner--extreme {
    background: #dc2626;
    color: #fff;
    animation: severePulse 3s ease-in-out infinite;
}

.severe-banner--extreme:hover {
    background: #b91c1c;
}

@keyframes severePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.88; }
}

.severe-banner-icon {
    font-size: 1.1rem;
}

/* ============================================
   WARNINGS SECTION (non-severe, lower on page)
   ============================================ */
.warnings-section {
    background: var(--color-bg-white);
    border-top: 1px solid var(--color-border);
    padding: 1.25rem 1rem;
}

.warnings-section.hidden {
    display: none;
}

.warnings-section-head {
    margin-bottom: 0.8rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--color-border-light);
}

.warnings-section-head h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
}

#warningsList {
    display: grid;
    gap: 10px;
}

.warning-item {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    border-left: 4px solid var(--warning-accent, var(--color-primary));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: none;
}

.warning-item.warning-level-1 {
    background: #ffffff;
}

.warning-item.warning-level-2 {
    background: #ffffff;
}

.warning-item.warning-level-3 {
    background: #ffffff;
}

.warning-item.warning-level-4 {
    background: #ffffff;
}

.warning-icon-wrap {
    width: 34px;
    min-width: 34px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2px;
}

.warning-icon {
    font-size: 1.2rem;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--color-border-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.warning-content {
    flex: 1;
    min-width: 0;
}

.warning-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 2px;
}

.warning-region {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.2px;
}

.warning-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.warning-level-chip {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    padding: 0;
    white-space: nowrap;
}

.warning-desc {
    font-size: 0.84rem;
    color: var(--color-text-secondary);
    line-height: 1.55;
}

.warning-meta {
    margin-top: 7px;
    font-size: 0.74rem;
    color: var(--color-text-muted);
}

/* ============================================
   PROGNOSIS SECTION (below map)
   ============================================ */
.prognosis-section {
    background: var(--color-bg-white);
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 1rem;
}

.prognosis-content-area {
    max-width: 1200px;
    margin: 0 auto;
}

.prognosis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.prognosis-column {
    min-width: 0;
}

.prognosis-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
    letter-spacing: -0.3px;
}

.prognosis-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: 0.85rem;
}

.prognosis-text strong {
    display: block;
    color: var(--color-text);
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.prognosis-empty {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

@media (max-width: 768px) {
    .prognosis-section {
        padding: 1.5rem 1rem;
    }
    
    .prognosis-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .prognosis-title {
        font-size: 1.15rem;
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS FOR NEW ELEMENTS
   ============================================ */
@media (max-width: 768px) {
    .map-wrapper {
        height: min(72vh, 640px);
        min-height: 320px;
    }

    .day-bar {
        flex-direction: column;
    }
    
    .day-selector {
        overflow-x: auto;
    }
    
    .day-btn {
        padding: 0.6rem 1rem;
        font-size: 0.82rem;
    }
    
    .day-bar-datetime {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        justify-content: center;
        padding: 0.5rem 1rem;
        font-size: 0.82rem;
    }
    
    .animation-controls {
        flex-wrap: wrap;
        gap: 8px;
        padding: 6px 1rem;
    }

    .layer-btn {
        padding: 3px 6px;
        font-size: 0.85rem;
    }
    
    .hour-slider {
        width: 150px;
    }
    
    .warnings-section {
        padding: 0.8rem;
    }
    
    .warning-item {
        padding: 10px 12px;
        gap: 8px;
    }

    .warning-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .warning-title {
        font-size: 0.85rem;
    }
    
    .warning-desc {
        font-size: 0.8rem;
    }
    
    .severe-banner {
        font-size: 0.82rem;
        padding: 8px 14px;
    }

    .view-tabs {
        padding: 0 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .footer-left {
        flex-direction: column;
        gap: 0.25rem;
    }
}
