/**
 * Stoßzeiten-Widget – Google-Popular-Times-Stil in Markenfarben
 * Pfad: /assets/css/utilization-popular-times.css (global, da mehrfach genutzt)
 * Eingebunden von:
 *  - /pages/station-detail/sections/utilization-popular-times.php (Sidebar-Karte)
 *  - /pages/operator/includes/utilization-section.php (Betreiber-Detailseite)
 */

.upt-widget {
    --upt-bar: hsl(var(--primary) / 0.45);
    --upt-bar-hover: hsl(var(--primary) / 0.65);
    --upt-bar-now: hsl(var(--primary));
    --upt-empty: hsl(var(--muted-foreground) / 0.18);
}

/* ---- Tages-Umschalter ---- */
.upt-day-tabs {
    display: flex;
    justify-content: space-between;
    gap: 2px;
    margin-bottom: 8px;
}

.upt-day-tab {
    flex: 1 1 0;
    padding: 4px 0 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.upt-day-tab:hover {
    color: hsl(var(--foreground));
    background: hsl(var(--muted) / 0.5);
}

.upt-day-tab--active {
    color: hsl(var(--primary));
    border-bottom-color: hsl(var(--primary));
}

/* Ø-Auslastung je Tag (Betreiber-Variante: kleine Zahl unter dem Tages-Kürzel) */
.upt-day-avg {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: hsl(var(--muted-foreground));
}

.upt-day-tab--active .upt-day-avg {
    color: hsl(var(--primary));
}

/* ---- Info-Zeile ("13 Uhr: normalerweise am stärksten besucht") ---- */
.upt-info {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
    min-height: 16px;
    margin-bottom: 6px;
    color: hsl(var(--muted-foreground));
}

.upt-info-strong {
    color: hsl(var(--primary));
    font-weight: 700;
}

/* ---- Balkendiagramm ---- */
.upt-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 88px;
    padding-bottom: 2px;
    border-bottom: 1px solid hsl(var(--border));
}

.upt-bar-slot {
    flex: 1 1 0;
    display: flex;
    align-items: flex-end;
    height: 100%;
    cursor: default;
}

.upt-bar {
    width: 100%;
    min-height: 3px;
    background: var(--upt-bar);
    border-radius: 3px 3px 0 0;
    transition: background-color 0.15s ease, height 0.25s ease;
}

.upt-bar-slot:hover .upt-bar {
    background: var(--upt-bar-hover);
}

.upt-bar--now {
    background: var(--upt-bar-now);
}

.upt-bar-slot:hover .upt-bar--now {
    background: var(--upt-bar-now);
}

.upt-bar--empty {
    background: var(--upt-empty);
}

.upt-bar-slot:hover .upt-bar--empty {
    background: var(--upt-empty);
}

/* ---- Fußnote ---- */
.upt-footnote {
    margin-top: 6px;
    font-size: 10px;
    line-height: 1.4;
    color: hsl(var(--muted-foreground));
}

/* ---- X-Achse ---- */
.upt-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 12px;
    color: hsl(var(--muted-foreground));
}

/* ---- Betreiber-Detailseite: Kachel-Stapel in der 1/3-Spalte ----
   Ab lg (1024px) werden die Statistik-Kacheln untereinander gestapelt
   (überschreibt das sm:grid-cols-2 fürs Tablet; lg:grid-cols-1 ist im
   lokalen Tailwind-Build nicht enthalten). */
@media (min-width: 1024px) {
    .upt-stat-stack {
        grid-template-columns: 1fr;
    }
}

/* ---- Große Variante (Betreiber-Detailseite, 2/3-Spalte) ---- */
.upt-widget--large .upt-chart {
    height: 160px;
    gap: 3px;
}

.upt-widget--large .upt-day-tab {
    font-size: 12px;
    padding: 6px 0 8px;
}

.upt-widget--large .upt-info {
    font-size: 13px;
    margin-bottom: 10px;
}

.upt-widget--large .upt-axis {
    font-size: 13px;
}

.upt-widget--large .upt-footnote {
    font-size: 11px;
}
