/* ================================================================= */
/* BASIS LAYOUT UND GLOBALE STILE */
/* ================================================================= */
body {
    font-family: Arial, sans-serif;
    background: #eef2f7;
    margin: 0;
    padding: 1rem;
    color: #222;
    /* Verhindert horizontalen Scrollbalken durch das Ausbrechen der Tabelle/Karte */
    overflow-x: hidden; 
}

header {
    margin-bottom: 1rem;
    text-align: center;
}

form {
    margin-bottom: 1rem;
}

input[type=text] {
    font-size: 1rem;
    padding: 0.5rem;
    width: 200px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

button {
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    background-color: #357edd;
    color: white;
    cursor: pointer;
    margin-left: 0.5rem;
}

button:hover {
    background-color: #2a65c7;
}

.warning {
    color: #a00;
    font-weight: bold;
    margin: 1rem 0;
    text-align: center;
}

.info-text {
    color: #333;
    font-size: 0.9em;
    margin: 0.5rem 0;
    text-align: center;
    font-weight: normal;
}

/* KORREKTUR: Erlaubt dem Container, die volle Breite zu nutzen */
.forecast-container {
    max-width: 100% !important; /* Wichtig: Überschreibt jede Begrenzung */
    width: 100%;
    margin: auto;
    background: white;
    border-radius: 8px;
    /* Padding auf 0 setzen, da .carousel-container das Padding jetzt übernimmt */
    padding: 0; 
    box-shadow: 0 0 12px #aaa;
    box-sizing: border-box;
}

h2 {
    text-align: center;
    margin-bottom: 1rem;
}

/* ================================================================= */
/* KARUSSELL UND INHALT STILE */
/* ================================================================= */

/* Karussell Container: Definiert den inneren Rahmen des Inhalts (z.B. 20px Rand) */
.carousel-container {
    position: relative;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
    /* Fügt den horizontalen Rand für alle normalen Elemente hinzu */
    padding: 1rem 20px; 
    box-sizing: border-box;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
    white-space: nowrap;
}

.day-row-wrapper {
    min-width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
    width: 100%;
    height: auto;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0; 
}

.day-row-wrapper.active {
    display: flex;
}

.daily-header {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #333;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

/* ----------------------------------------------------------------- */
/* NAVIGATION */
/* ----------------------------------------------------------------- */
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 0.8rem 0.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    z-index: 10;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.carousel-nav-btn.prev {
    left: 0; 
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.carousel-nav-btn.next {
    right: 0;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.carousel-nav-btn:hover {
    opacity: 1;
}

.carousel-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}


/* ----------------------------------------------------------------- */
/* TABELLE FIX: Bricht aus und wird scrollbar (Desktop) */
/* ----------------------------------------------------------------- */
.day-table-container {
    /* Bricht über das 20px Padding des .carousel-container hinaus (+20px links, +20px rechts) */
    width: calc(100% + 40px); 
    margin-left: -20px;       
    
    /* Erzeugt den horizontalen Scrollbalken */
    overflow-x: auto; 
    margin-bottom: 20px; 
    
    /* Fügt Padding FÜR den SCROLL-INHALT hinzu */
    padding: 0 20px; 
    box-sizing: border-box; 
    
    /* Entfernt nicht benötigte Flex- und Höhenregeln aus der vorherigen Version */
    max-width: none;
    flex: none; 
    height: auto; 
    max-height: none;
    overflow-y: visible;
}

/* Die eigentliche Wettertabelle */
.day-table {
    width: auto; 
    min-width: 1200px; /* Erzwingt das Scrollen */
    
    border-collapse: collapse;
    table-layout: auto; 
    border: none !important; 
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.day-table th, 
.day-table td {
    padding: 0.4rem;
    text-align: center;
    border-bottom: 1px solid #ddd;
}
.day-table th {
    background: #f4f8fc;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}

tr:last-child td {
    border-bottom: none;
}

/* ----------------------------------------------------------------- */
/* DIAGRAMM und KARTE */
/* ----------------------------------------------------------------- */
.day-chart-container {
    width: 100%;
    height: 250px;
    position: relative;
    box-sizing: border-box;
    padding: 0;
    margin-bottom: 20px;
}

.day-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* KARTE FIX: Bricht über den Rand aus (wie die Tabelle) */
.day-map-container {
    /* Bricht wie die Tabelle über den Rand aus */
    width: calc(100% + 40px); 
    margin-left: -20px;
    
    height: 300px; 
    margin-top: 20px;
    
    /* Fügt Padding FÜR den Inhalt (die Karte) hinzu */
    padding: 0 20px; 
    box-sizing: border-box;
    
    border: none;
    box-shadow: none;
}

.map-leaflet {
    width: 100%;
    height: 100%;
    z-index: 1;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Erforderlich für den rotierenden Pfeil in der Tabelle */
.wind-arrow {
    display: inline-block;
    transition: transform 0.5s ease; /* Ermöglicht eine weiche Drehung, falls Sie JS dafür nutzen */
    font-size: 1.2em;
    margin-right: 5px;
    color: #333; /* Standardfarbe */
}

/* ================================================================= */
/* MOBILE ANPASSUNG (< 768px) */
/* ================================================================= */
@media (max-width: 768px) {
    
    /* Tabelle nicht mehr ausbrechen, sondern das Padding des Containers nutzen. Scrollen bleibt. */
    .day-table-container {
        width: 100%; 
        margin-left: 0;
        padding: 0; 
        
        overflow-x: auto; 
        margin-bottom: 1rem;
    }
    
    /* Karte nicht mehr ausbrechen, sondern das Padding des Containers nutzen */
    .day-map-container {
        width: 100%;
        margin-left: 0;
        padding: 0;
    }

    .chart-and-map-wrapper {
        flex: 0 0 100%;
        min-width: unset;
    }

    .day-chart-container, .day-map-container {
        width: 100%;
        margin-top: 15px;
    }
}
