/* ==========================================================================
   Marco Budow Portfolio - Homelab-Detailseite & Live-Status-Panel
   Status-Farben validiert (dataviz: CVD-Separation + Normalsicht-Floor,
   beide Modi auf den echten Kartenflächen #ffffff / #1a1a1a):
   up #2a9d8f · degraded #fab219 · down #d03b3b (+ neutrales Grau "keine Daten").
   Warnfarbe ist auf Weiß bewusst hell -> Bedeutung nie über Farbe allein:
   Icon + Textlabel + Vorfalls-Text pro Zeile + Tooltip (Relief-Regel).
   ========================================================================== */

:root {
    --st-up: #2a9d8f;
    --st-warn: #fab219;
    --st-down: #d03b3b;
    --st-nodata: #e9e9e9;
    --st-cell-ring: rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] {
    --st-nodata: #333333;
    --st-cell-ring: rgba(255, 255, 255, 0.22);
}

/* ==========================================================================
   Seitenkopf der Detailseite
   ========================================================================== */

.project-hero {
    padding-top: 140px;
    padding-bottom: var(--spacing-md);
}

.project-hero .back-link {
    display: inline-block;
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1.25rem;
}

.project-hero .back-link:hover {
    color: var(--primary-color);
}

.project-hero h1 {
    font-size: 2.75rem;
    margin-bottom: 0.75rem;
}

.project-hero .project-hero__teaser {
    max-width: 720px;
    font-size: 1.15rem;
    color: var(--text-light);
}

/* ==========================================================================
   Status-Panel
   ========================================================================== */

.status-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Demo-Hinweis (wird beim Live-Gang entfernt) */
.status-demo-note {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(250, 178, 25, 0.12);
    border: 1px dashed var(--st-warn);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

/* Kopfzeile: Gesamtstatus + Aktualisierung */
.status-overall {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.status-overall__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--st-up);
    flex-shrink: 0;
}

.status-overall--warn .status-overall__dot { background: var(--st-warn); }
.status-overall--down .status-overall__dot { background: var(--st-down); }

@media (prefers-reduced-motion: no-preference) {
    .status-overall--up .status-overall__dot {
        animation: statusPulse 2.4s ease-in-out infinite;
    }
    @keyframes statusPulse {
        0%, 100% { box-shadow: 0 0 0 0 rgba(42, 157, 143, 0.35); }
        50%      { box-shadow: 0 0 0 7px rgba(42, 157, 143, 0); }
    }
}

.status-overall__label {
    font-family: "Outfit", sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color);
}

.status-overall__meta {
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0;
}

/* Hinweis, wenn das Homelab sich nicht meldet (Staleness) */
.status-stale {
    display: none;
    background: rgba(250, 178, 25, 0.12);
    border: 1px solid var(--st-warn);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    margin: 1rem 0 0;
}

.status-stale.visible { display: block; }

/* Kennzahlen-Kacheln */
.status-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.status-tile {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.25rem;
}

.status-tile__label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.status-tile__value {
    font-family: "Inter", sans-serif;
    font-size: 1.85rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.15;
}

.status-tile__hint {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 0.2rem;
    margin-bottom: 0;
}

/* Dienst-Zeilen */
.status-rows {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.status-row {
    display: grid;
    grid-template-columns: minmax(210px, 260px) 1fr auto;
    gap: 0.5rem 1.25rem;
    align-items: center;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-color);
}

.status-row__head {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    min-width: 0;
}

.status-row__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    align-self: center;
}

.status-row__dot--up     { background: var(--st-up); }
.status-row__dot--warn   { background: var(--st-warn); border: 1px solid var(--st-cell-ring); }
.status-row__dot--down   { background: var(--st-down); }
.status-row__dot--nodata { background: var(--st-nodata); border: 1px solid var(--st-cell-ring); }

.status-row__name {
    font-family: "Outfit", sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.status-row__detail {
    display: block;
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 0.82rem;
    color: var(--text-light);
}

.status-row__numbers {
    text-align: right;
    white-space: nowrap;
}

.status-row__uptime {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
}

.status-row__state {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* 90-Tage-Streifen: Zellen mit 2px Flächen-Abstand (Surface-Gap) */
.status-strip {
    display: flex;
    gap: 2px;
    align-items: stretch;
    height: 30px;
    min-width: 0;
}

.status-strip span {
    flex: 1 1 0;
    min-width: 2px;
    border-radius: 2px;
    cursor: default;
}

.status-strip span.up     { background: var(--st-up); }
.status-strip span.warn   { background: var(--st-warn); box-shadow: inset 0 0 0 1px var(--st-cell-ring); }
.status-strip span.down   { background: var(--st-down); }
.status-strip span.nodata { background: var(--st-nodata); }

.status-strip span:hover {
    outline: 2px solid var(--text-color);
    outline-offset: 1px;
}

/* Legende: Icon + Label, nie Farbe allein */
.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    margin-top: 1.5rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-light);
}

.status-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.status-legend i {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    font-style: normal;
}

.status-legend .up     { background: var(--st-up); }
.status-legend .warn   { background: var(--st-warn); box-shadow: inset 0 0 0 1px var(--st-cell-ring); }
.status-legend .down   { background: var(--st-down); }
.status-legend .nodata { background: var(--st-nodata); box-shadow: inset 0 0 0 1px var(--st-cell-ring); }

/* Tooltip (JS-positioniert) */
.status-tooltip {
    position: fixed;
    z-index: 2000;
    pointer-events: none;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    line-height: 1.45;
    max-width: 240px;
    opacity: 0;
    transition: opacity 0.12s;
}

.status-tooltip.visible { opacity: 1; }

.status-tooltip strong {
    display: block;
    font-size: 0.9rem;
}

/* Lade-/Fehlerzustand */
.status-loading {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

/* Screenreader-Zusammenfassungen */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 820px) {
    .status-row {
        grid-template-columns: 1fr auto;
    }
    .status-row__head {
        grid-column: 1;
    }
    .status-row__numbers {
        grid-column: 2;
        grid-row: 1;
    }
    .status-strip {
        grid-column: 1 / -1;
        height: 26px;
    }
    .status-strip span:nth-child(-n+30) {
        display: none; /* mobil: letzte 60 Tage zeigen */
    }
    .project-hero h1 {
        font-size: 2.1rem;
    }
}
