/* css/_weather.css - Vertikale Stapelung & Kompakt */

.weather-content {
    /* Setzt die maximale Breite des Modals auf 850px */
    max-width: 850px; 
    width: 95%;
    padding: 1.5rem;
}

.weather-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
    color: var(--accent-color);
    text-align: center;
    font-family: 'Exo 2', system-ui, sans-serif;
}

/* ========================================================== */
/* LAYOUT: Vertikale Stapelung (HEUTE oben, 4 TAGE unten) */
/* ========================================================== */
.weather-sections {
    display: flex;
    flex-direction: column; 
    gap: 20px; 
    align-items: center; 
}


/* ========================================================== */
/* 1. HEUTE: Prominente Darstellung (Breite angepasst)    */
/* ========================================================== */
.weather-today-box {
    background: var(--panel-bg); 
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    padding: 12px; 
    box-shadow: 0 4px 15px var(--shadow-color);
    
    /* NEU: Breite auf das Raster von 4 Spalten (685px) fixiert */
    width: 685px; 
    max-width: 100%; 
    
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
    
    position: relative;
    overflow: hidden;
}

.weather-today-box .day-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.weather-today-box .day-header h3 {
    font-size: 1.3em;
    margin: 0;
}
.weather-today-box .day-header .date {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Flex-Container für Vormittags/Nachmittags NEBENeinander (innerhalb der HEUTE-Box) */
.day-parts-inline {
    display: flex;
    gap: 15px; 
    justify-content: space-around;
    flex-wrap: wrap;
}

.day-part-today {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
    padding: 10px; 
    border-radius: 8px;
    border: 1px solid var(--divider-color);
    text-align: center;
    background: var(--bg-color); 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.day-part-today.warn {
    border-color: #ff4757; 
    background: rgba(255, 71, 87, 0.1); 
}

.part-symbol-large {
    font-size: 3em;
    display: block;
    line-height: 1.2;
    margin: 3px 0; 
}

.part-temp-large {
    font-weight: bold;
    font-size: 1.8em;
    display: block;
    color: var(--accent-color);
    margin-bottom: 3px; 
}

.part-extra-today {
    margin-top: 8px; 
    display: flex;
    justify-content: space-around;
    font-size: 0.9em;
    opacity: 0.8;
}
.part-desc {
    font-size: 1em;
    display: block;
    margin-top: 3px;
    font-weight: 600; 
}


/* ========================================================== */
/* 2. NÄCHSTE 4 TAGE: Horizontale Scrollansicht */
/* ========================================================== */
.weather-grid {
    display: flex;
    gap: 15px;
    
    overflow-x: auto; 
    
    padding-bottom: 10px;
    border-top: 1px solid var(--divider-color);
    padding-top: 15px;
    
    width: 685px; 
    max-width: 100%;
}

.weather-day {
    flex: 0 0 160px; 
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 5px var(--shadow-color);
    text-align: center;
    border: 1px solid var(--divider-color);
}

.weather-day .day-header {
    margin-bottom: 5px;
}
.weather-day .day-header h3 {
    margin: 0;
    font-size: 1.1em;
}

/* ******************************************************** */
/* WETTER ABSCHNITT (Vormittags/Nachmittags in den 4 Tagen) */
/* ******************************************************** */

.day-part {
    border-top: 1px dashed var(--divider-color);
    padding: 10px 0;
    margin-top: 5px;
}

.day-part:first-of-type {
    border-top: none; 
}

.day-part.warn {
    background: rgba(var(--accent-color-rgb), 0.1);
    border: 2px solid var(--accent-color); 
    border-radius: 6px;
    padding: 8px 0;
    margin: 5px 0;
}

.part-time {
    font-weight: bold;
    font-size: 0.9em;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.part-symbol {
    font-size: 1.8em;
    display: block;
    line-height: 1;
    margin-bottom: 5px;
}

.part-temp {
    font-weight: bold;
    font-size: 1.2em;
    display: block;
}

.part-desc {
    font-size: 0.85em;
    display: block;
    margin-top: 3px;
    font-weight: 600; 
}

.part-extra {
    font-size: 0.8em;
    opacity: 0.8;
    margin-top: 5px;
    display: flex;
    justify-content: space-around;
}

/* MEDIA QUERY: Anpassung für HEUTE auf kleinen Bildschirmen (< 800px) */
@media (max-width: 800px) {
    /* Stapelt Vormittag/Nachmittag untereinander in der HEUTE-Box bei kleinen Screens */
    .day-parts-inline {
        flex-direction: column;
        gap: 10px;
    }
    .day-part-today {
        max-width: 100%;
        min-width: unset;
        padding: 8px; 
    }
    
    /* Skaliert die Schriftgrößen in der HEUTE-Box DEUTLICH stärker */
    .weather-today-box {
        padding: 10px; 
    }
    .weather-today-box .day-header h3 {
        font-size: 1em; 
    }
    .part-symbol-large {
        font-size: 2em; 
        margin: 0; 
    }
    .part-temp-large {
        font-size: 1.2em; 
        margin-bottom: 2px;
    }
    .part-desc {
        font-size: 0.85em;
    }
    .part-extra-today {
        font-size: 0.8em;
        margin-top: 5px;
    }
}

/* --- KRITISCHE MOBILE-REGEL: Gilt NUR für das Wetter-Modal --- */
@media (max-width: 600px) {
    
    /* 1. ÄUSSERES OVERLAY: Puffer zum Fensterrand */
    #weatherModal {
        padding: 15px !important; 
    }
    
    /* 2. INNERE BOX: entfernt horizontalen Padding (damit es bündig zum Screenrand läuft) */
    /* !!!!!!!! SPEZIFISCHER SELEKTOR IST KRITISCH !!!!!!!! */
    #weatherModal .weather-content {
        /* Vertikaler Padding bleibt erhalten */
        padding-top: 1.5rem !important; 
        padding-bottom: 1.5rem !important;
        
        /* WICHTIG: Setzt den horizontalen Padding auf 0, um Ränder zu verhindern */
        padding-left: 0 !important; 
        padding-right: 0 !important;
        
        width: 100% !important;
        max-width: none !important;
        margin: 0 auto !important; 
    }

    /* 3. PADDING SHIFT: Fügt den horizontalen Abstand ZUM INHALT HINZU (nicht zur Box) */
    .weather-content h2,
    .weather-content .weather-sections {
        /* Setzt den originalen horizontalen Padding von 1.5rem (24px) 
           direkt auf die Hauptinhaltsblöcke. */
        padding-left: 1.5rem; 
        padding-right: 1.5rem;
    }
}