/* ==========================================================================
   webx_weather — Wetter-Widget Stylesheet (Atomic, monochrom)
   ==========================================================================
   - Eigenständig, kein Bootstrap, kein @import.
   - Lädt ausschließlich auf der Wetterseite (WeatherController::showAction
     hängt diese Datei via PageRenderer ein).
   - Farbschema: reine Neutralgrau-Skala. Material-Icons erben currentColor;
     dadurch sind Icons und Text immer in derselben Farbe.
   ========================================================================== */

@font-face {
    font-family: "Material Symbols Outlined";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../Fonts/MaterialSymbolsOutlined.woff2") format("woff2");
}

.webx-weather {
    /* Tokens — eine Datei, eine Skala. Wenn irgendwo ein Hue auftaucht,
       liegt es nicht an dieser CSS. */
    --ww-ink:        #1a1a1a;   /* Primärtext, dunkel */
    --ww-ink-soft:   #4a4a4a;   /* Sekundärtext, Detail-Werte */
    --ww-ink-muted:  #7a7a7a;   /* Labels, „muted" */
    --ww-rule:       rgba(0, 0, 0, .08);
    --ww-bg:         #fafafa;
    --ww-bg-alt:     #f3f3f3;
    --ww-card-bg:    #ffffff;
    --ww-card-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    --ww-radius:     12px;
    --ww-gap:        16px;
    --ww-tab-pad-y:  8px;
    --ww-tab-pad-x:  14px;

    color: var(--ww-ink);
    background: var(--ww-bg);
    padding: 20px 16px;
    border-radius: var(--ww-radius);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

.webx-weather__inner {
    display: flex;
    flex-direction: column;
    gap: var(--ww-gap);
    max-width: 720px;
    margin: 0 auto;
}

/* AJAX-Loading-State: dezent abdimmen, ohne den DOM-Tausch zu blockieren. */
.webx-weather--loading .webx-weather__inner {
    opacity: 0.55;
    transition: opacity 0.15s ease-in-out;
    pointer-events: none;
}

/* Mobile: maximale Breite nutzen, ohne dass die umliegende .container.content
   (Bootstrap, padding: 0 30px) und das eigene Padding zu viel wegnehmen.
   Karten sollen praktisch randständig sitzen — analog iOS-Wetter. */
@media (max-width: 768px) {
    .webx-weather {
        padding: 8px 0;
        border-radius: 0;
        background: transparent;
        --ww-gap: 10px;
    }
    .webx-weather > .container.content,
    .webx-weather .container.content {
        padding-left: 8px !important;
        padding-right: 8px !important;
        max-width: none !important;
    }
    .webx-weather .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .webx-weather .col-12 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Material Symbols (Outlined) — Font-Face wird über die separate
   weather-icons.css ausgeliefert, falls vorhanden. Wir setzen hier nur
   einheitliches Rendering und Farbe via currentColor. */
.webx-weather .material-symbols-outlined {
    font-family: "Material Symbols Outlined", sans-serif;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: "liga";
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
    color: inherit;
    vertical-align: -3px;
}

/* --- Section-Titles ------------------------------------------------------ */

.webx-weather .ww-section-title,
.webx-weather .ww-sub-title {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--ww-ink-muted);
    font-weight: 500;
    margin: 0 0 4px;
}

.webx-weather .ww-section-title {
    font-size: 14px;
    margin: 4px 0 8px;
}

.webx-weather .ww-h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--ww-ink);
}

/* --- Location-Tabs ------------------------------------------------------- */

.webx-weather .weather-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    justify-content: flex-start;
}

.webx-weather a.weather-tab,
.webx-weather .weather-tab {
    margin: 0;
    background: var(--ww-card-bg);
    border: 1px solid var(--ww-rule);
    color: var(--ww-ink-soft);
    padding: var(--ww-tab-pad-y) var(--ww-tab-pad-x);
    border-radius: 999px;
    font-size: 13px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: .4px;
    text-transform: none;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.webx-weather a.weather-tab:hover,
.webx-weather .weather-tab:hover {
    background: var(--ww-bg-alt);
    color: var(--ww-ink);
    border-color: var(--ww-ink-muted);
}

.webx-weather a.weather-tab.weather-tab--active,
.webx-weather .weather-tab.weather-tab--active {
    background: var(--ww-ink);
    color: var(--ww-card-bg);
    border-color: var(--ww-ink);
}

/* --- Warning Banner ------------------------------------------------------ */

.webx-weather .weather-warning {
    background: var(--ww-card-bg);
    border: 1px solid var(--ww-ink-muted);
    border-radius: var(--ww-radius);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--ww-ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Nowcast-Card -------------------------------------------------------- */

.ww-card,
.webx-weather .weather-nowcast {
    background: var(--ww-card-bg);
    color: var(--ww-ink);
    border: 1px solid var(--ww-rule);
    border-radius: var(--ww-radius);
    padding: 18px 20px;
    box-shadow: var(--ww-card-shadow);
}

.webx-weather .weather-nowcast__main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 4px 0 14px;
}

.webx-weather .weather-nowcast__temp {
    font-size: 44px;
    line-height: 1;
    font-weight: 700;
    color: var(--ww-ink);
}

.webx-weather .weather-nowcast__condition {
    display: block;
    font-size: 14px;
    color: var(--ww-ink-soft);
    margin-top: 4px;
}

.webx-weather .weather-nowcast__icon {
    color: var(--ww-ink);
}

.webx-weather .weather-nowcast__icon .material-symbols-outlined {
    font-size: 48px;
    color: inherit;
}

/* Detail-Reihe unter dem Nowcast: Wind / Niederschlag / Schneefall / UV */
.webx-weather .weather-nowcast__details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.webx-weather .weather-detail {
    background: var(--ww-bg-alt);
    border-radius: 8px;
    padding: 8px 10px;
    text-align: left;
    color: var(--ww-ink-soft);
    font-size: 13px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.webx-weather .weather-detail .material-symbols-outlined {
    color: inherit;          /* gegen Browser-Defaults absichern */
    font-size: 18px;
}

.webx-weather .weather-detail span:last-child {
    color: var(--ww-ink);
    font-weight: 600;
}

/* Override gegen die alte „blaue" Rain-Detail-Card. */
.webx-weather .weather-detail--rain,
.webx-weather .weather-detail--rain .material-symbols-outlined,
.webx-weather .weather-detail--rain span {
    color: var(--ww-ink-soft);
}

.webx-weather .weather-detail--rain span:last-child {
    color: var(--ww-ink);
}

/* --- Hourly-Strip (6–21 Uhr, 3h-Schritte) --------------------------------- */

.webx-weather .weather-section {
    background: var(--ww-card-bg);
    border: 1px solid var(--ww-rule);
    border-radius: var(--ww-radius);
    padding: 14px 16px;
    box-shadow: var(--ww-card-shadow);
}

.webx-weather .weather-section__title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ww-ink);
    margin: 0 0 12px;
}

.webx-weather .weather-hourly {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

@media (max-width: 540px) {
    .webx-weather .weather-hourly {
        grid-template-columns: repeat(3, 1fr);
    }
}

.webx-weather .weather-hourly__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px;
    border-radius: 8px;
    color: var(--ww-ink-soft);
    transition: background 0.15s, color 0.15s;
    cursor: default;
}

.webx-weather .weather-hourly__item:hover {
    background: var(--ww-bg-alt);
    color: var(--ww-ink);
}

.webx-weather .weather-hourly__item--now {
    background: var(--ww-ink);
    color: var(--ww-card-bg);
}

.webx-weather .weather-hourly__time {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .3px;
    color: inherit;
}

.webx-weather .weather-hourly__icon img,
.webx-weather .weather-hourly__icon .material-symbols-outlined {
    width: 24px;
    height: 24px;
    color: inherit;
    /* Weather-Icons aus wettercom sind farbig; in monochromer Variante
       wechseln wir auf das Material-Icon (s. Template-Anpassung). */
}

.webx-weather .weather-hourly__temp {
    font-size: 14px;
    font-weight: 600;
    color: inherit;
}

/* --- Daily-Forecast (Akkordeon) ------------------------------------------ */

.webx-weather .ww-section-title {
    margin-top: 4px;
}

.webx-weather .ww-forecast {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.webx-weather .forecast-card {
    background: var(--ww-card-bg);
    border: 1px solid var(--ww-rule);
    border-radius: var(--ww-radius);
    overflow: hidden;
    box-shadow: var(--ww-card-shadow);
}

.webx-weather .forecast-header {
    width: 100%;
    border: 0;
    background: transparent;
    display: grid;
    grid-template-columns: 36px 1fr auto 28px;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--ww-ink);
    text-align: left;
}

.webx-weather .forecast-header:hover {
    background: var(--ww-bg-alt);
}

.webx-weather .forecast-header__icon .material-symbols-outlined {
    font-size: 28px;
    color: var(--ww-ink-soft);
}

.webx-weather .forecast-header__date strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ww-ink);
    line-height: 1.2;
}

.webx-weather .forecast-header__date span {
    display: block;
    font-size: 11px;
    color: var(--ww-ink-muted);
    margin-top: 2px;
    letter-spacing: .3px;
}

.webx-weather .forecast-header__temp {
    font-size: 14px;
    font-weight: 600;
    color: var(--ww-ink);
    font-variant-numeric: tabular-nums;
}

.webx-weather .forecast-header__toggle .material-symbols-outlined {
    font-size: 22px;
    color: var(--ww-ink-muted);
    transition: transform 0.2s;
}

.webx-weather .forecast-card[aria-expanded="true"] .forecast-header__toggle .material-symbols-outlined {
    transform: rotate(180deg);
}

.webx-weather .forecast-details {
    display: none;
    padding: 4px 14px 12px;
    border-top: 1px solid var(--ww-rule);
}

.webx-weather .forecast-card[aria-expanded="true"] .forecast-details {
    display: block;
}

.webx-weather .forecast-text {
    margin: 8px 0 12px;
    font-size: 13px;
    color: var(--ww-ink-soft);
    line-height: 1.5;
}

.webx-weather .hourly-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Akkordeon-Zeile als tabellarisches Raster:
   feste Spalten für Zeit / Icon / Temperatur, danach Wind/Regen je 1fr.
   Zahlen sind tabular-nums → exakt vertikal bündig zwischen Zeilen.
   Auf engen Viewports wandern Wind+Regen via grid-template-areas
   sauber in eine zweite Reihe darunter. */
.webx-weather .hourly-item {
    display: grid;
    grid-template-columns: 56px 32px 56px 1fr 1fr;
    grid-template-areas: "time icon temp wind rain";
    align-items: center;
    column-gap: 10px;
    row-gap: 2px;
    padding: 8px 6px;
    border-bottom: 1px solid var(--ww-rule);
    font-size: 13px;
    color: var(--ww-ink-soft);
}

.webx-weather .hourly-item:last-child {
    border-bottom: 0;
}

.webx-weather .hourly-item__time {
    grid-area: time;
    font-weight: 500;
    color: var(--ww-ink);
    font-variant-numeric: tabular-nums;
    text-align: left;
}

.webx-weather .hourly-item__icon {
    grid-area: icon;
    display: flex;
    justify-content: center;
}

.webx-weather .hourly-item__icon .material-symbols-outlined {
    color: var(--ww-ink-soft);
    font-size: 22px;
}

.webx-weather .hourly-item__temp {
    grid-area: temp;
    text-align: right;
    font-weight: 600;
    color: var(--ww-ink);
    font-variant-numeric: tabular-nums;
}

.webx-weather .hourly-item__wind,
.webx-weather .hourly-item__rain {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--ww-ink-soft);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.webx-weather .hourly-item__wind {
    grid-area: wind;
    justify-content: flex-start;
}

.webx-weather .hourly-item__rain {
    grid-area: rain;
    justify-content: flex-end;
}

.webx-weather .hourly-item__wind .material-symbols-outlined,
.webx-weather .hourly-item__rain .material-symbols-outlined {
    color: inherit;
    font-size: 18px;
    flex-shrink: 0;
}

/* Schmaler Viewport: Zeit/Icon/Temp behalten ihr Raster; Wind+Regen
   landen in einer zweiten Zeile darunter (eingerückt unter Temp). */
@media (max-width: 480px) {
    .webx-weather .hourly-item {
        grid-template-columns: 56px 32px 1fr 1fr;
        grid-template-areas:
            "time icon temp temp"
            "wind wind rain rain";
        row-gap: 4px;
    }
    .webx-weather .hourly-item__wind { justify-content: flex-start; padding-left: 4px; }
    .webx-weather .hourly-item__rain { justify-content: flex-end;   padding-right: 4px; }
}

.webx-weather .hourly-empty {
    margin-top: 8px;
    font-size: 12px;
    color: var(--ww-ink-muted);
    text-align: center;
    padding: 8px;
}

/* --- Pollen -------------------------------------------------------------- */

.webx-weather .weather-section--pollen {
    background: var(--ww-card-bg);
    border: 1px solid var(--ww-rule);
}

.webx-weather .weather-pollen {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
}

.webx-weather .weather-pollen__item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ww-ink-soft);
}

.webx-weather .weather-pollen__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ww-ink);
    flex-shrink: 0;
}

.webx-weather .weather-pollen__name {
    color: var(--ww-ink);
    font-weight: 500;
}

.webx-weather .weather-pollen__level {
    color: var(--ww-ink-muted);
}

/* Monochrome Pollen-Level: Punktgröße statt Farbe als Intensitätssignal */
.webx-weather .weather-pollen__item[data-level="0"] .weather-pollen__dot { background: transparent; border: 1px solid var(--ww-ink-muted); }
.webx-weather .weather-pollen__item[data-level="1"] .weather-pollen__dot { background: var(--ww-ink-muted); }
.webx-weather .weather-pollen__item[data-level="2"] .weather-pollen__dot { background: var(--ww-ink-soft); }
.webx-weather .weather-pollen__item[data-level="3"] .weather-pollen__dot { background: var(--ww-ink); }

/* --- No-Data ------------------------------------------------------------- */

.webx-weather .weather-nodata {
    text-align: center;
    padding: 48px 24px;
    color: var(--ww-ink-muted);
    font-size: 16px;
}
