/* =========================================
   GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --bg-start: #1a1a1a;
    --bg-end: #b2b6bd;
    --card-bg: #2a2a2a;
    --dashboard-bg: #1a1a1a;
    --main-text: #F0F0F0;
    --secondary-text: #aaa;
    --border-color: #333;
    --shadow-color: rgba(0, 0, 0, 0.7);
    --circle-start: #2b2b2b;
    --circle-end: #151515;
}

/* =========================================
   LIGHT MODE (TAG-ANSICHT)
   ========================================= */

body.is-day {
    --bg-start: #f0f0f0; 
    --bg-end: #E8E8E8;
    --card-bg: #ffffff; 
    --dashboard-bg: #f8f8f8;
    --main-text: #333333;
    --secondary-text: #666;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --circle-start: #f9f9f9;
    --circle-end: #e9e9e9;
    color: var(--main-text);
}


/* =========================================
   ALLGEMEINES LAYOUT
   ========================================= */
body {
    font-family: var(--main-font, 'Rubik', 'Segoe UI', sans-serif);
    background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
    background-attachment: fixed; 
    color: var(--main-text);
    margin: 0; padding: 0;
    display: flex; justify-content: center; align-items: flex-start;
    min-height: 100vh; font-size: 14px;
    transition: background 1s ease, color 0.5s ease;
}

#dashboard-container {
    width: 90%; max-width: 960px;
    background-color: var(--dashboard-bg);
    border-radius: 10px;
    box-shadow: 0 0 20px var(--shadow-color);
    padding: 20px;
    margin-top: 20px; margin-bottom: 40px; 
    display: grid; gap: 15px;
    transition: background-color 0.5s ease, box-shadow 0.5s ease;
}

/* Header */
.header-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 10px; background-color: var(--dashboard-bg); border-radius: 5px;
    font-size: 0.9em; color: var(--secondary-text); 
    border-bottom: 2px solid var(--border-color); margin-bottom: 5px; 
    transition: color 0.5s, border-color 0.5s, background-color 0.5s; 
}
.header-bar .logo { 
    font-weight: bold; color: var(--main-text); font-size: 1.1em; 
    transition: color 0.5s; 
}
body.is-day .header-bar {
    background-color: #ffffff;
}

/* =========================================
   TOGGLE BUTTON STYLE
   ========================================= */
#mode-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px 10px;
    margin-left: 10px;
    color: var(--secondary-text);
    transition: color 0.3s, transform 0.1s, border 0.3s, border-radius 0.3s;
    outline: none;
}

#mode-toggle-btn:hover {
    color: var(--main-text);
    transform: scale(1.1);
}

body.is-day #mode-toggle-btn.night-mode {
    color: #4A90E2;
}

/* =========================================
   ADMIN/SETTINGS BUTTON IN HEADER
   ========================================= */
#dashboard-container .header-bar a.admin-link-footer { 
    background-color: var(--card-bg);
    border: 2px solid var(--border-color); 
    color: var(--secondary-text); 
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1; 
    text-decoration: none; 
}

body.is-day #dashboard-container .header-bar a.admin-link-footer {
    background-color: #ffffff;
    border-color: var(--border-color);
    color: var(--secondary-text); 
}

#dashboard-container .header-bar a.admin-link-footer:hover {
    box-shadow: 0 0 10px currentColor; 
    transform: scale(1.05);
}


/* =========================================
   WARNUNGS BANNER (MITTE)
   ========================================= */
#warning-banner {
    background-color: #d32f2f;
    color: #ffffff;
    text-align: center;
    padding: 15px;
    margin: 5px 0; 
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.2em;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: warning-pulse 2s infinite;
}

@keyframes warning-pulse {
    0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7); transform: scale(1); }
    70% { box-shadow: 0 0 0 10px rgba(211, 47, 47, 0); transform: scale(1.01); }
    100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); transform: scale(1); }
}


/* =========================================
   HAUPT-STATUS-GRID (KREISE)
   ========================================= */
.main-stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); 
    gap: 15px; margin-top: 15px; justify-items: center; 
}
@media (max-width: 768px) { .main-stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .main-stats-grid { grid-template-columns: 1fr; } }

.circle-display-wrapper {
    display: flex; flex-direction: column; align-items: center;     
    justify-content: center; text-align: center; position: relative; 
    padding-bottom: 20px; width: 100%; 
}

.circle-display {
    width: 100px; height: 100px; font-size: 1.8em; 
    border-radius: 50%; border: 2px solid var(--border-color);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    font-weight: bold; 
    position: relative; 
    overflow: visible !important; 
    color: var(--main-text); 
    background: linear-gradient(145deg, var(--circle-start), var(--circle-end));
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5), 0 5px 15px rgba(0,0,0,0.3);
    transition: color 0.5s, border-color 0.5s, box-shadow 0.2s, background 0.5s;
}
.circle-display.large { width: 150px; height: 150px; font-size: 2.5em; }

body.is-day .circle-display {
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.1);
}

/* Webcam Kreis */
.circle-display.webcam-circle {
    padding: 0; overflow: hidden !important; 
    cursor: pointer; background: #000; border: 2px solid #555; display: block; 
}
.circle-display.webcam-circle img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.5s; }

.circle-display i, 
.circle-display .circle-value, 
.circle-display .circle-unit {
    position: relative; z-index: 10; 
    text-shadow: 0 2px 5px rgba(0,0,0,0.8); 
}
body.is-day .circle-display i,
body.is-day .circle-display .circle-value,
body.is-day .circle-display .circle-unit {
     text-shadow: none; 
}

body.is-day #wind-speed-display i,
body.is-day #wind-speed-display .circle-value {
    color: var(--main-text) !important;
}

.circle-display i, #wind-icon { font-size: 1.0em; margin-bottom: 3px; color: inherit; }
#wind-direction-arrow { display: none; }
.circle-display#wind-speed-display .circle-value { color: var(--main-text) !important; }

#wind-direction-indicator {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; transition: transform 0.5s ease-out; z-index: 20; transform-origin: 50% 50%; 
    color: #FF3333 !important; 
}

.circle-display#wind-speed-display #wind-direction-indicator::before,
#dashboard-container .circle-display-wrapper .circle-display#wind-speed-display #wind-direction-indicator::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translate(-50%, -20px); 
    width: 0; height: 0; border-style: solid; border-width: 0 8px 20px 8px; 
    border-color: transparent transparent #FF3333 transparent !important; 
}

#lb-wind-indicator {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; transition: transform 0.5s ease-out; z-index: 20; transform-origin: 50% 50%;
    display: none; color: #FF3333 !important; 
}
#lb-wind-indicator::before {
    content: ''; position: absolute; top: 0; left: 50%; 
    width: 0; height: 0; border-style: solid; border-width: 0 25px 60px 25px; 
    border-color: transparent transparent #FF3333 transparent !important; 
    transform: translate(-50%, -80px); 
}

.circle-value { line-height: 1; }
.circle-unit { font-size: 0.5em; font-weight: normal; color: var(--secondary-text); margin-top: -5px; }
.circle-label-bottom { margin-top: 10px; font-size: 1em; font-weight: 500; color: #ccc; width: 100%; text-align: center; }
body.is-day .circle-label-bottom { color: #555; }
.no-transition { transition: none !important; }


/* =========================================
   TREND INDIKATOREN (PFEILE)
   ========================================= */
.trend-indicator {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em !important; z-index: 1; opacity: 0; pointer-events: none;
}

@keyframes trend-flash {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    10%  { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
    80%  { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); } 
}

.trend-up { color: #4CAF50; animation: trend-flash 3s ease-in-out forwards; }
.trend-down { color: #ff4d4d; animation: trend-flash 3s ease-in-out forwards; }

#dashboard-container #wind-speed-display #wind_speed_trend.trend-up i { color: #4CAF50 !important; }
#dashboard-container #wind-speed-display #wind_speed_trend.trend-down i { color: #ff4d4d !important; }
#lb-trend.trend-up i { color: #4CAF50 !important; }
#lb-trend.trend-down i { color: #ff4d4d !important; }

.circle-display.highlight-up {
    border-color: #4CAF50 !important; box-shadow: 0 0 15px #4CAF50, inset 0 2px 5px rgba(0,0,0,0.5);
    transition: box-shadow 0.2s, border-color 0.2s;
}
.circle-display.highlight-down {
    border-color: #ff4d4d !important; box-shadow: 0 0 15px #ff4d4d, inset 0 2px 5px rgba(0,0,0,0.5);
    transition: box-shadow 0.2s, border-color 0.2s;
}

@keyframes detail-pulse { 0% { color: #F0F0F0; transform: scale(1); } 50% { color: #FF9800; transform: scale(1.05); } 100% { color: #F0F0F0; transform: scale(1); } }
body.is-day @keyframes detail-pulse { 0% { color: #333; transform: scale(1); } 50% { color: #FF9800; transform: scale(1.05); } 100% { color: #333; transform: scale(1); } }
.data-value.pulse-change { animation: detail-pulse 1s ease-out; }


/* =========================================
   DETAIL KARTEN & FARBEN
   ========================================= */
.middle-row-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
@media (min-width: 600px) { .middle-row-grid { grid-template-columns: 1fr 1fr; } }
.detail-card-left, .detail-card-right { 
    background-color: var(--card-bg); padding: 15px; border-radius: 8px; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); transition: background-color 0.5s ease;
}
body.is-day .detail-card-left, body.is-day .detail-card-right {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 
}

.detail-card-left h3, .detail-card-right h3 { 
    margin-top: 0; font-size: 1.1em; font-weight: 500; color: var(--main-text); 
    border-bottom: 1px solid var(--border-color); padding-bottom: 5px; margin-bottom: 10px; 
    border-left: 4px solid var(--border-color); padding-left: 10px;
    transition: color 0.5s, border-bottom-color 0.5s, border-left-color 0.5s;
}

.detail-card-left p, .detail-card-right p { 
    margin: 5px 0; font-size: 1em; display: flex; justify-content: space-between; align-items: center; 
    color: var(--main-text); transition: color 0.5s;
}
.detail-card-left p i, .detail-card-right p i { 
    margin-right: 10px; color: #C5E1A5; transition: color 0.5s; 
}
body.is-day .detail-card-left p i, body.is-day .detail-card-right p i { 
    color: var(--main-text); 
}

/* Wind-Farben (Border des Kreises) */
.wind-calm { color: #EEEEEE; border-color: #EEEEEE !important; }
.wind-light { color: #B3E5FC; border-color: #B3E5FC !important; }
.wind-medium { color: #4DB6AC; border-color: #4DB6AC !important; }
.wind-strong { color: #FFB300; border-color: #FFB300 !important; }
.wind-high { color: #E53935; border-color: #E53935 !important; }

/* Feuchtigkeits-Farben (Border des Kreises und Icons in Details) */
.humidity-dry { color: #FFCC80; border-color: #FFCC80 !important; }
.humidity-optimal { color: #A5D6A7; border-color: #A5D6A7 !important; }
.humidity-moist { color: #81D4FA; border-color: #81D4FA !important; }
.humidity-high { color: #4FC3F7; border-color: #4FC3F7 !important; }

.data-value { font-weight: bold; color: var(--main-text); margin-left: auto; transition: color 0.5s; }
.data-unit, .unit-time { font-size: 0.8em; color: var(--secondary-text); margin-left: 5px; transition: color 0.5s; }
.value-no-unit { font-size: 1em; } .value-no-unit-full { text-align: right; width: 100%; }
.astro-divider { border: 0; height: 1px; background-color: var(--border-color); margin: 10px 0; transition: background-color 0.5s; }

/* Charts & Footer */
.chart-section-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
@media (min-width: 600px) { .chart-section-grid { grid-template-columns: 1fr 1fr; } }
.chart-card { 
    background-color: var(--card-bg); padding: 15px; border-radius: 8px; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); height: 300px; position: relative; 
    transition: background-color 0.5s, box-shadow 0.5s;
}
body.is-day .chart-card {
     box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.chart-card h3 { 
    margin-top: 0; font-size: 1.1em; font-weight: 500; color: var(--main-text); margin-bottom: 10px; 
    border-left: 4px solid var(--border-color); padding-left: 10px; border-bottom: 1px solid var(--border-color); padding-bottom: 5px;
    transition: color 0.5s, border-left-color 0.5s, border-bottom-color 0.5s;
}

.footer-bar { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 10px 0; margin-top: 20px; font-size: 0.8em; color: #888; border-top: 1px solid var(--border-color); 
    transition: border-top-color 0.5s;
}

.admin-link-footer { color: #444; font-size: 1.2em; text-decoration: none; transition: color 0.3s; margin-left: 10px; }
.admin-link-footer:hover { color: var(--main-text); }
body.is-day .admin-link-footer { color: #bbb; }


/* =========================================
   LIGHTBOX & MEGA MODE 
   ========================================= */
.lightbox {
    display: none; position: fixed; z-index: 9999; 
    left: 0; top: 0; width: 100vw; height: 100vh; 
    background-color: rgba(0, 0, 0, 0.95); overflow: hidden; 
    align-items: center; justify-content: center; backdrop-filter: blur(5px);
}
.lightbox-content {
    max-width: 100vw; max-height: 100vh; display: flex; justify-content: center; align-items: center;
    position: relative; border-radius: 8px; animation-name: zoom; animation-duration: 0.6s; 
}
.lightbox-content img { max-width: 95vw; max-height: 95vh; width: auto; height: auto; display: block; object-fit: contain; cursor: pointer; }
.lightbox-close { position: absolute; top: 20px; right: 30px; color: #f1f1f1; font-size: 40px; font-weight: bold; cursor: pointer; z-index: 10001; }
@keyframes zoom { from {transform: scale(0.8); opacity: 0;} to {transform: scale(1); opacity: 1;} }

.circle-display.mega-size {
    width: 50vmin; height: 50vmin; font-size: 14vmin; border-width: 6px; 
    box-shadow: 0 0 50px rgba(0,0,0,0.8), inset 0 0 20px rgba(0,0,0,0.5);
    background: linear-gradient(145deg, var(--circle-start), var(--circle-end)); 
    position: relative; overflow: visible !important; margin: 0; display: flex; flex-direction: column; justify-content: center; align-items: center;
}
body.is-day .circle-display.mega-size { background: linear-gradient(145deg, #f9f9f9, #e9e9e9); box-shadow: 0 0 50px rgba(0,0,0,0.3), inset 0 0 20px rgba(0,0,0,0.1); }

@media (max-width: 768px) {
    .circle-display.mega-size { width: 80vmin; height: 80vmin; font-size: 22vmin; }
    .circle-display.mega-size .circle-label-bottom { font-size: 1.2rem !important; top: 105%; }
}

.circle-display.mega-size i { font-size: 0.6em; margin-bottom: 0.1em; color: var(--main-text); }
body.is-day .circle-display.mega-size i { color: #333333 !important; }
.circle-display.mega-size .circle-value { line-height: 0.9; color: var(--main-text); }
.circle-display.mega-size .circle-unit { font-size: 0.3em; margin-top: 0.1em; color: var(--secondary-text); }
body.is-day .circle-display.mega-size .circle-value { color: #333333 !important; }
body.is-day .circle-display.mega-size .circle-unit { color: #666666 !important; }

.circle-display.mega-size .trend-indicator { font-size: 4em !important; }
.circle-display.mega-size .circle-label-bottom { position: absolute; top: 110%; left: 50%; transform: translateX(-50%); width: auto; white-space: nowrap; color: var(--main-text); display: block !important; }


/* =========================================
   WETTERVORSCHAU (FORECAST)
   ========================================= */
.forecast-card { 
    background-color: var(--card-bg); padding: 15px; border-radius: 8px; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); margin-top: 0; transition: background-color 0.5s, box-shadow 0.5s;
}
body.is-day .forecast-card { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }

.forecast-card h2, #about-section h3, #visitor-card h3 { 
    font-size: 1.1em; font-weight: 500; color: var(--main-text); margin-top: 0; margin-bottom: 15px; 
    border-bottom: 1px solid var(--border-color); padding-bottom: 5px; 
    border-left: 4px solid var(--border-color); padding-left: 10px; 
    transition: border-left-color 0.5s, color 0.5s, border-bottom-color 0.5s; 
}

#about-section p.about-text { color: #888; font-size: 0.95em; line-height: 1.5; margin-top: 10px; margin-bottom: 0; transition: color 0.5s; }
body.is-day #about-section p.about-text { color: #666; }
#about-section p.about-text strong { color: var(--main-text); font-weight: 500; transition: color 0.5s; }
body.is-day #about-section p.about-text strong { color: #333; }

.weather-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 1024px) { .weather-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .weather-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .weather-grid { grid-template-columns: 1fr; } }

.weather-day { 
    background-color: #222; padding: 10px; border-radius: 8px; box-shadow: inset 0 0 10px rgba(0,0,0,0.2); 
    display: flex; flex-direction: column; gap: 6px; border: 1px solid #333; transition: background-color 0.5s, border-color 0.5s;
}
body.is-day .weather-day { background-color: #f3f3f3; border: 1px solid #e0e0e0; box-shadow: inset 0 0 5px rgba(0,0,0,0.05); }

.weather-day .day-header { 
    display: flex; justify-content: space-between; font-weight: bold; border-bottom: 1px solid #444; padding-bottom: 4px; margin-bottom: 2px; 
    color: #ddd; font-size: 0.95em; transition: color 0.5s, border-bottom-color 0.5s;
}
body.is-day .weather-day .day-header { color: #333; border-bottom-color: #ccc; }

.day-part { background: rgba(255,255,255,0.03); border-radius: 5px; padding: 8px; margin-bottom: 0; transition: background 0.5s, border 0.5s; }
body.is-day .day-part { background: rgba(0,0,0,0.05); }
.day-part.warn { background: rgba(129, 212, 250, 0.1); border: 1px solid rgba(129, 212, 250, 0.3); }

.part-time { font-size: 0.75em; color: #888; text-transform: uppercase; margin-bottom: 4px; border-bottom: 1px solid #333; padding-bottom: 2px; }
body.is-day .part-time { color: #999; border-bottom-color: #ccc; }
.part-details { display: flex; flex-direction: column; gap: 1px; }
.part-symbol { font-size: 1.4em; display: block; margin-bottom: 2px; }
.part-temp { font-weight: bold; font-size: 0.95em; color: #fff; white-space: nowrap; }
body.is-day .part-temp { color: #333; }
.part-desc { font-size: 0.8em; opacity: 0.8; display: block; margin-top: 1px; line-height: 1.2; }
.part-extra { display: flex; justify-content: space-between; font-size: 0.75em; color: #ccc; margin-top: 5px; padding-top: 3px; border-top: 1px solid #444; transition: border-top-color 0.5s; }
body.is-day .part-extra { border-top-color: #ccc; color: #666; }
.weather-day.today-card { border-width: 1px; border-style: solid; border-color: #444; transition: border-color 0.5s; }


/* =========================================
   SEITLICHES THERMOMETER
   ========================================= */
.side-thermometer-wrapper {
    position: fixed; top: 50%; left: 5%; transform: translateY(-50%);
    display: none; flex-direction: column; align-items: center; gap: 15px; z-index: 50;
    background-color: var(--dashboard-bg); border: 2px solid var(--border-color); border-radius: 20px;
    padding: 30px 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.6); min-width: 120px;
    transition: background-color 0.5s, border-color 0.5s, box-shadow 0.5s;
}
body.is-day .side-thermometer-wrapper { box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
@media (min-width: 1450px) { .side-thermometer-wrapper { display: flex; left: calc((100vw - 1000px) / 4); transform: translate(-50%, -50%); } }

.thermometer-body { position: relative; width: 90px; height: 400px; display: flex; justify-content: center; }
.thermometer-scale { position: absolute; left: 0; top: 10px; bottom: 50px; width: 100%; pointer-events: none; }
.tick { position: absolute; left: 25px; width: 30px; border-bottom: 2px solid #666; height: 0; transition: border-color 0.5s; }
body.is-day .tick { border-color: #999; }
.tick.small { width: 15px; left: 40px; border-bottom: 1px solid #555; opacity: 0.6; }
body.is-day .tick.small { border-bottom-color: #aaa; }
.tick span { position: absolute; left: -45px; top: -7px; font-size: 0.85em; font-weight: bold; text-align: right; width: 40px; color: var(--main-text); transition: color 0.5s; }

.tick.scorching { border-color: #D32F2F; } .tick.scorching span { color: #D32F2F; }
.tick.hot { border-color: #E64A19; } .tick.hot span { color: #E64A19; }
.tick.warm { border-color: #F39C12; } .tick.warm span { color: #F39C12; }
.tick.mild { border-color: #689F38; } .tick.mild span { color: #689F38; }
.tick.cool { border-color: #43A047; } .tick.cool span { color: #43A047; }
.tick.zero { border-color: #1E88E5; border-width: 3px; width: 35px; } .tick.zero span { color: #1E88E5; font-size: 1.1em; text-shadow: 0 0 5px #1E88E5; }
body.is-day .tick.zero span { text-shadow: none; }
.tick.cold { border-color: #039BE5; } .tick.cold span { color: #039BE5; }
.tick.freezing { border-color: #5E35B1; } .tick.freezing span { color: #5E35B1; }

.thermometer-tube { width: 16px; height: calc(100% - 50px); background: #222; border: 2px solid #444; border-bottom: none; border-radius: 10px 10px 0 0; position: relative; z-index: 1; overflow: hidden; transition: background 0.5s, border 0.5s; }
body.is-day .thermometer-tube { background: #eee; border: 2px solid #ccc; }
.tube-bg { position: absolute; top:0; left:0; width:100%; height:100%; background: linear-gradient(to right, rgba(255,255,255,0.05), transparent, rgba(255,255,255,0.05)); z-index: 0; }
body.is-day .tube-bg { background: linear-gradient(to right, rgba(0,0,0,0.05), transparent, rgba(0,0,0,0.05)); }
.thermometer-fill { position: absolute; bottom: 0; left: 0; width: 100%; height: 0%; background-color: #ccc; transition: height 1s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s; z-index: 1; box-shadow: 0 0 10px currentColor; animation: liquid-pulse 3s infinite alternate; }
.thermometer-fill::after { content: ''; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 100%; height: 10px; border-radius: 50%; background: inherit; filter: brightness(1.5); box-shadow: 0 -2px 6px rgba(255,255,255,0.6); animation: surface-splash 6s infinite ease-in-out; }
.thermometer-bulb { position: absolute; bottom: 0; width: 54px; height: 54px; border-radius: 50%; background: #2a2a2a; border: 2px solid #444; z-index: 2; box-shadow: 0 4px 15px rgba(0,0,0,0.6); transition: background 0.5s, border 0.5s, box-shadow 0.5s; }
body.is-day .thermometer-bulb { background: #ffffff; border: 2px solid #ccc; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.thermometer-bulb::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background-color: #ccc; transition: background 0.5s; box-shadow: 0 0 20px currentColor; animation: liquid-pulse 3s infinite alternate; }
.thermometer-text { font-size: 2.5em; font-weight: bold; color: var(--main-text); text-shadow: 0 2px 5px rgba(0,0,0,0.5); margin-top: 5px; transition: color 0.5s; }
body.is-day .thermometer-text { text-shadow: none; }
.thermometer-text .unit { font-size: 0.5em; color: #888; transition: color 0.5s; }

@keyframes liquid-pulse { 0% { opacity: 0.85; box-shadow: 0 0 8px currentColor; } 100% { opacity: 1; box-shadow: 0 0 16px currentColor; } }
@keyframes surface-splash { 0%, 80% { transform: translateX(-50%) scaleY(1); border-radius: 50%; top: -6px; } 82% { transform: translateX(-50%) scaleY(0.8); top: -5px; } 85% { transform: translateX(-50%) scaleY(1.8) skewX(5deg); border-radius: 40% 60% 50% 50%; top: -9px; } 90% { transform: translateX(-50%) scaleY(0.9) skewX(-5deg); top: -5px; } 100% { transform: translateX(-50%) scaleY(1); top: -6px; } }

/* =========================================
   DYNAMISCHER WARN-BANNER
   ========================================= */
#warning-banner {
    width: 100%; padding: 18px 20px; margin-bottom: 0; margin-top: 0; border-radius: 8px; font-weight: bold; text-align: center; box-sizing: border-box; display: none; align-items: center; justify-content: center; gap: 15px; font-size: 1.2em; line-height: 1.1; 
    --warning-bg: #D32F2F; background-color: var(--warning-bg); animation: warning-pulse 2s infinite; box-shadow: 0 4px 10px rgba(0,0,0,0.5); transition: background-color 0.5s ease, color 0.5s ease;
}
@keyframes warning-pulse {
    0% { box-shadow: 0 0 0 0 var(--warning-bg); }
    70% { box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); } 
    100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

/* =========================================
   MOBILE FIX
   ========================================= */
html { box-sizing: border-box; overflow-x: hidden; }
*, *::before, *::after { box-sizing: inherit; }

@media (max-width: 768px) {
    #dashboard-container { display: flex !important; flex-direction: column !important; width: 100% !important; max-width: 100% !important; padding: 10px !important; margin: 10px 0 !important; gap: 15px; border: none !important; box-shadow: none !important; }
    .chart-card, .forecast-card, .detail-card-left, .detail-card-right, #about-section, #visitor-card, .header-bar, .footer-bar, .main-stats-grid { width: 100% !important; margin: 0 !important; min-width: 0 !important; box-sizing: border-box !important; }
    .chart-card { padding: 10px 10px 35px 10px !important; overflow: hidden !important; display: flex !important; flex-direction: column; min-height: 350px !important; }
    canvas { flex-grow: 1 !important; width: 100% !important; max-width: 100% !important; height: auto !important; }
    .weather-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 10px !important; }
}

@media (min-width: 600px) {
    #forecast-section { grid-column: 1 / -1 !important; }
}

/* =========================================
   STATISTIK SECTION
   ========================================= */
.stats-card { margin-top: 20px; border-left: 4px solid #4aa3df; display: flex; flex-direction: column; justify-content: center; }
.stats-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; color: var(--secondary-text); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.stats-row-clean { display: flex; justify-content: space-around; align-items: center; width: 100%; }
.stat-item-clean { display: flex; flex-direction: column; align-items: center; position: relative; flex: 1; }
.stat-item-clean:not(:last-child)::after { content: ""; position: absolute; right: 0; top: 10%; height: 80%; width: 1px; background-color: var(--border-color); opacity: 0.5; }
.stat-val-clean { font-size: 1.6rem; font-weight: 700; color: var(--main-text); line-height: 1.2; }
.stat-label-clean { font-size: 0.75rem; color: var(--secondary-text); text-transform: uppercase; margin-top: 2px; }
.stat-trend { font-size: 0.7rem; color: var(--secondary-text); opacity: 0.7; margin-top: 2px; }


/* =========================================
   HOCHKONTRAST 5°C TEMPERATUR-SPRÜNGE
   ========================================= */

/* --- <= -10°C (Dunkles Magenta/Violett: #8E24AA) --- */
.header-bar.temp-m10 .logo { color: #8E24AA !important; }
#mode-toggle-btn.temp-m10 { border-color: #8E24AA !important; }
#dashboard-container .header-bar.temp-m10 a.admin-link-footer { border-color: #8E24AA !important; color: #8E24AA !important; }
.temp-m10 { color: #8E24AA; border-color: #8E24AA !important; }
.detail-card-left.temp-m10 i, .detail-card-right.temp-m10 i { color: #8E24AA !important; }
.detail-card-left.temp-m10 h3, .detail-card-right.temp-m10 h3 { border-left-color: #8E24AA !important; }
#dashboard-container .chart-card.temp-m10 h3, .forecast-card.temp-m10 h2, #about-section.temp-m10 h3, #visitor-card.temp-m10 h3 { border-left-color: #8E24AA !important; }
.forecast-card.temp-m10 .weather-day.today-card { border-color: #8E24AA !important; }
.side-thermometer-wrapper.temp-m10 .thermometer-fill { background: linear-gradient(to top, #4A148C, #8E24AA); color: #8E24AA; }
.side-thermometer-wrapper.temp-m10 .thermometer-bulb::after { background: radial-gradient(circle at 30% 30%, #BA68C8, #8E24AA); color: #8E24AA; }

/* --- -5°C bis -9.9°C (Tiefes Indigo: #5E35B1) --- */
.header-bar.temp-m5 .logo { color: #5E35B1 !important; }
#mode-toggle-btn.temp-m5 { border-color: #5E35B1 !important; }
#dashboard-container .header-bar.temp-m5 a.admin-link-footer { border-color: #5E35B1 !important; color: #5E35B1 !important; }
.temp-m5 { color: #5E35B1; border-color: #5E35B1 !important; }
.detail-card-left.temp-m5 i, .detail-card-right.temp-m5 i { color: #5E35B1 !important; }
.detail-card-left.temp-m5 h3, .detail-card-right.temp-m5 h3 { border-left-color: #5E35B1 !important; }
#dashboard-container .chart-card.temp-m5 h3, .forecast-card.temp-m5 h2, #about-section.temp-m5 h3, #visitor-card.temp-m5 h3 { border-left-color: #5E35B1 !important; }
.forecast-card.temp-m5 .weather-day.today-card { border-color: #5E35B1 !important; }
.side-thermometer-wrapper.temp-m5 .thermometer-fill { background: linear-gradient(to top, #311B92, #5E35B1); color: #5E35B1; }
.side-thermometer-wrapper.temp-m5 .thermometer-bulb::after { background: radial-gradient(circle at 30% 30%, #9575CD, #5E35B1); color: #5E35B1; }

/* --- 0°C bis -4.9°C (Kräftiges Blau: #1E88E5) --- */
.header-bar.temp-0 .logo { color: #1E88E5 !important; }
#mode-toggle-btn.temp-0 { border-color: #1E88E5 !important; }
#dashboard-container .header-bar.temp-0 a.admin-link-footer { border-color: #1E88E5 !important; color: #1E88E5 !important; }
.temp-0 { color: #1E88E5; border-color: #1E88E5 !important; }
.detail-card-left.temp-0 i, .detail-card-right.temp-0 i { color: #1E88E5 !important; }
.detail-card-left.temp-0 h3, .detail-card-right.temp-0 h3 { border-left-color: #1E88E5 !important; }
#dashboard-container .chart-card.temp-0 h3, .forecast-card.temp-0 h2, #about-section.temp-0 h3, #visitor-card.temp-0 h3 { border-left-color: #1E88E5 !important; }
.forecast-card.temp-0 .weather-day.today-card { border-color: #1E88E5 !important; }
.side-thermometer-wrapper.temp-0 .thermometer-fill { background: linear-gradient(to top, #0D47A1, #1E88E5); color: #1E88E5; }
.side-thermometer-wrapper.temp-0 .thermometer-bulb::after { background: radial-gradient(circle at 30% 30%, #64B5F6, #1E88E5); color: #1E88E5; }

/* --- 0.1°C bis 5°C (Helles, sattes Blau: #039BE5) --- */
.header-bar.temp-5 .logo { color: #039BE5 !important; }
#mode-toggle-btn.temp-5 { border-color: #039BE5 !important; }
#dashboard-container .header-bar.temp-5 a.admin-link-footer { border-color: #039BE5 !important; color: #039BE5 !important; }
.temp-5 { color: #039BE5; border-color: #039BE5 !important; }
.detail-card-left.temp-5 i, .detail-card-right.temp-5 i { color: #039BE5 !important; }
.detail-card-left.temp-5 h3, .detail-card-right.temp-5 h3 { border-left-color: #039BE5 !important; }
#dashboard-container .chart-card.temp-5 h3, .forecast-card.temp-5 h2, #about-section.temp-5 h3, #visitor-card.temp-5 h3 { border-left-color: #039BE5 !important; }
.forecast-card.temp-5 .weather-day.today-card { border-color: #039BE5 !important; }
.side-thermometer-wrapper.temp-5 .thermometer-fill { background: linear-gradient(to top, #01579B, #039BE5); color: #039BE5; }
.side-thermometer-wrapper.temp-5 .thermometer-bulb::after { background: radial-gradient(circle at 30% 30%, #4FC3F7, #039BE5); color: #039BE5; }

/* --- 5.1°C bis 10°C (Dunkles Türkis/Teal: #00897B) --- */
.header-bar.temp-10 .logo { color: #00897B !important; }
#mode-toggle-btn.temp-10 { border-color: #00897B !important; }
#dashboard-container .header-bar.temp-10 a.admin-link-footer { border-color: #00897B !important; color: #00897B !important; }
.temp-10 { color: #00897B; border-color: #00897B !important; }
.detail-card-left.temp-10 i, .detail-card-right.temp-10 i { color: #00897B !important; }
.detail-card-left.temp-10 h3, .detail-card-right.temp-10 h3 { border-left-color: #00897B !important; }
#dashboard-container .chart-card.temp-10 h3, .forecast-card.temp-10 h2, #about-section.temp-10 h3, #visitor-card.temp-10 h3 { border-left-color: #00897B !important; }
.forecast-card.temp-10 .weather-day.today-card { border-color: #00897B !important; }
.side-thermometer-wrapper.temp-10 .thermometer-fill { background: linear-gradient(to top, #004D40, #00897B); color: #00897B; }
.side-thermometer-wrapper.temp-10 .thermometer-bulb::after { background: radial-gradient(circle at 30% 30%, #4DB6AC, #00897B); color: #00897B; }

/* --- 10.1°C bis 15°C (Kräftiges Grün: #43A047) --- */
.header-bar.temp-15 .logo { color: #43A047 !important; }
#mode-toggle-btn.temp-15 { border-color: #43A047 !important; }
#dashboard-container .header-bar.temp-15 a.admin-link-footer { border-color: #43A047 !important; color: #43A047 !important; }
.temp-15 { color: #43A047; border-color: #43A047 !important; }
.detail-card-left.temp-15 i, .detail-card-right.temp-15 i { color: #43A047 !important; }
.detail-card-left.temp-15 h3, .detail-card-right.temp-15 h3 { border-left-color: #43A047 !important; }
#dashboard-container .chart-card.temp-15 h3, .forecast-card.temp-15 h2, #about-section.temp-15 h3, #visitor-card.temp-15 h3 { border-left-color: #43A047 !important; }
.forecast-card.temp-15 .weather-day.today-card { border-color: #43A047 !important; }
.side-thermometer-wrapper.temp-15 .thermometer-fill { background: linear-gradient(to top, #1B5E20, #43A047); color: #43A047; }
.side-thermometer-wrapper.temp-15 .thermometer-bulb::after { background: radial-gradient(circle at 30% 30%, #81C784, #43A047); color: #43A047; }

/* --- 15.1°C bis 20°C (Sattes Waldgrün/Olive: #689F38) --- */
.header-bar.temp-20 .logo { color: #689F38 !important; }
#mode-toggle-btn.temp-20 { border-color: #689F38 !important; }
#dashboard-container .header-bar.temp-20 a.admin-link-footer { border-color: #689F38 !important; color: #689F38 !important; }
.temp-20 { color: #689F38; border-color: #689F38 !important; }
.detail-card-left.temp-20 i, .detail-card-right.temp-20 i { color: #689F38 !important; }
.detail-card-left.temp-20 h3, .detail-card-right.temp-20 h3 { border-left-color: #689F38 !important; }
#dashboard-container .chart-card.temp-20 h3, .forecast-card.temp-20 h2, #about-section.temp-20 h3, #visitor-card.temp-20 h3 { border-left-color: #689F38 !important; }
.forecast-card.temp-20 .weather-day.today-card { border-color: #689F38 !important; }
.side-thermometer-wrapper.temp-20 .thermometer-fill { background: linear-gradient(to top, #33691E, #689F38); color: #689F38; }
.side-thermometer-wrapper.temp-20 .thermometer-bulb::after { background: radial-gradient(circle at 30% 30%, #AED581, #689F38); color: #689F38; }

/* --- 20.1°C bis 25°C (Kräftiges Goldorange: #F39C12) --- */
.header-bar.temp-25 .logo { color: #F39C12 !important; }
#mode-toggle-btn.temp-25 { border-color: #F39C12 !important; }
#dashboard-container .header-bar.temp-25 a.admin-link-footer { border-color: #F39C12 !important; color: #F39C12 !important; }
.temp-25 { color: #F39C12; border-color: #F39C12 !important; }
.detail-card-left.temp-25 i, .detail-card-right.temp-25 i { color: #F39C12 !important; }
.detail-card-left.temp-25 h3, .detail-card-right.temp-25 h3 { border-left-color: #F39C12 !important; }
#dashboard-container .chart-card.temp-25 h3, .forecast-card.temp-25 h2, #about-section.temp-25 h3, #visitor-card.temp-25 h3 { border-left-color: #F39C12 !important; }
.forecast-card.temp-25 .weather-day.today-card { border-color: #F39C12 !important; }
.side-thermometer-wrapper.temp-25 .thermometer-fill { background: linear-gradient(to top, #E67E22, #F39C12); color: #F39C12; }
.side-thermometer-wrapper.temp-25 .thermometer-bulb::after { background: radial-gradient(circle at 30% 30%, #F8C471, #F39C12); color: #F39C12; }

/* --- 25.1°C bis 30°C (Sattes Orange: #E64A19) --- */
.header-bar.temp-30 .logo { color: #E64A19 !important; }
#mode-toggle-btn.temp-30 { border-color: #E64A19 !important; }
#dashboard-container .header-bar.temp-30 a.admin-link-footer { border-color: #E64A19 !important; color: #E64A19 !important; }
.temp-30 { color: #E64A19; border-color: #E64A19 !important; }
.detail-card-left.temp-30 i, .detail-card-right.temp-30 i { color: #E64A19 !important; }
.detail-card-left.temp-30 h3, .detail-card-right.temp-30 h3 { border-left-color: #E64A19 !important; }
#dashboard-container .chart-card.temp-30 h3, .forecast-card.temp-30 h2, #about-section.temp-30 h3, #visitor-card.temp-30 h3 { border-left-color: #E64A19 !important; }
.forecast-card.temp-30 .weather-day.today-card { border-color: #E64A19 !important; }
.side-thermometer-wrapper.temp-30 .thermometer-fill { background: linear-gradient(to top, #BF360C, #E64A19); color: #E64A19; }
.side-thermometer-wrapper.temp-30 .thermometer-bulb::after { background: radial-gradient(circle at 30% 30%, #FF8A65, #E64A19); color: #E64A19; }

/* --- > 30°C (Dunkles, angenehmes Rot: #D32F2F) --- */
.header-bar.temp-35 .logo { color: #D32F2F !important; }
#mode-toggle-btn.temp-35 { border-color: #D32F2F !important; }
#dashboard-container .header-bar.temp-35 a.admin-link-footer { border-color: #D32F2F !important; color: #D32F2F !important; }
.temp-35 { color: #D32F2F; border-color: #D32F2F !important; }
.detail-card-left.temp-35 i, .detail-card-right.temp-35 i { color: #D32F2F !important; }
.detail-card-left.temp-35 h3, .detail-card-right.temp-35 h3 { border-left-color: #D32F2F !important; }
#dashboard-container .chart-card.temp-35 h3, .forecast-card.temp-35 h2, #about-section.temp-35 h3, #visitor-card.temp-35 h3 { border-left-color: #D32F2F !important; }
.forecast-card.temp-35 .weather-day.today-card { border-color: #D32F2F !important; }
.side-thermometer-wrapper.temp-35 .thermometer-fill { background: linear-gradient(to top, #B71C1C, #D32F2F); color: #D32F2F; }
.side-thermometer-wrapper.temp-35 .thermometer-bulb::after { background: radial-gradient(circle at 30% 30%, #EF5350, #D32F2F); color: #D32F2F; }