body, html {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.weather-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(to bottom, #a0d8ff, #ffffff);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background 1s ease;
}

body[weather="EXTRASUNNY"] .weather-background { background: url('/homepage/weather/assets/sun.gif') no-repeat center center, linear-gradient(to bottom, #a0d8ff, #ffffff); background-size: cover; }
body[weather="RAIN"] .weather-background { background: url('/homepage/weather/assets/rain.gif') no-repeat center center, linear-gradient(to bottom, #a0d8ff, #ffffff); background-size: cover; }
body[weather="THUNDER"] .weather-background { background: url('/homepage/weather/assets/thunder.gif') no-repeat center center, linear-gradient(to bottom, #a0d8ff, #ffffff); background-size: cover; }
body[weather="CLOUDS"] .weather-background { background: url('/homepage/weather/assets/clouds.gif') no-repeat center center, linear-gradient(to bottom, #a0d8ff, #ffffff); background-size: cover; }
body[weather="SMOG"] .weather-background { background: url('/homepage/weather/assets/smog.gif') no-repeat center center, linear-gradient(to bottom, #a0d8ff, #ffffff); background-size: cover; }
body[weather="CLEARING"] .weather-background { background: url('/homepage/weather/assets/clearing.gif') no-repeat center center, linear-gradient(to bottom, #a0d8ff, #ffffff); background-size: cover; }
body[weather=""], body:not([weather]) .weather-background { background: linear-gradient(to bottom, #a0d8ff, #ffffff); }

.weather-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    color: #0a0a0a;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    flex: 1 0 auto; /* Container wächst und nimmt Platz ein */
}

header { text-align: center; margin-bottom: 2rem; }
header h1 { font-size: 2.2rem; }
.avg-temp { font-size: 1.2rem; margin-top: 0.5rem; color: #0056b3; }

.weekly-forecast .days { display: flex; justify-content: space-between; flex-wrap: wrap; }

.day-card {
    background: rgba(255,255,255,0.25);
    border-radius: 12px;
    padding: 1rem;
    width: 13%;
    min-width: 120px;
    text-align: center;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.day-card:hover { transform: translateY(-5px) scale(1.05); box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
.day-card i { font-size: 2rem; margin-bottom: 0.5rem; display: block; animation: float 3s ease-in-out infinite; }
.day-card .label, .day-card .weekday, .day-card .date, .day-card .temp { margin-top: 0.2rem; }

.hourly-forecast { margin-top: 3rem; }
canvas {
    width: 100% !important;
    height: auto !important; /* Höhe passt sich automatisch an */
    max-height: 400px; /* Optional: Max-Höhe */
}

.hourly-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.hour-card {
    background: rgba(255,255,255,0.25);
    border-radius: 10px;
    padding: 8px;
    width: 80px;
    text-align: center;
    transition: transform 0.2s ease;
    cursor: default;
}
.hour-card:hover { transform: scale(1.1); box-shadow: 0 4px 10px rgba(0,0,0,0.25); }
.hour-card i { font-size: 1.5rem; margin: 3px 0; display: block; animation: float 3s ease-in-out infinite; }
.hour-time { font-size: 0.75rem; }
.hour-label { font-size: 0.75rem; margin: 2px 0; }
.hour-temp { font-weight: bold; font-size: 0.8rem; }

footer {
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    z-index: 10;
    flex-shrink: 0; /* Footer bleibt am Ende */
}

.weather-alert {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,69,0,0.9);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    /* animation: fadeinout 0.5s ease forwards; */
}

@keyframes fadeinout {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    10%, 90% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Mobile Optimierungen */
@media (max-width: 768px) {
    .weather-container { padding: 1rem; }
    .day-card { width: 30%; min-width: 100px; margin-bottom: 0.5rem; }
    .hourly-cards { flex-wrap: nowrap; overflow-x: auto; }
    canvas { height: 300px !important; }
}

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.hour-card.danger-hour {
    border: 2px solid red;
    background-color: rgba(255,0,0,0.2);
    font-weight: bold;
}
