/* ITR Status Page – Public CSS v1.1 */
.itr-sp { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 820px; margin: 0 auto; color: #1d2327; }

/* ── Alert Banner — immer ganz oben, sehr auffällig ──────────────────────── */
.itr-sp-alert-banner { margin-bottom: 24px; display: flex; flex-direction: column; gap: 12px; }

.itr-sp-alert { display: flex; gap: 16px; padding: 18px 20px; border-radius: 10px; border: 2px solid; }
.itr-sp-alert--critical { background: #fff0f0; border-color: #e53935; }
.itr-sp-alert--high     { background: #fffbf0; border-color: #ff9800; }
.itr-sp-alert--low      { background: #f0f7ff; border-color: #2196f3; }
.itr-sp-alert--info     { background: #f8f8f8; border-color: #9e9e9e; }

.itr-sp-alert-icon { font-size: 22px; line-height: 1; flex-shrink: 0; padding-top: 2px; }
.itr-sp-alert-body { flex: 1; }
.itr-sp-alert-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.itr-sp-alert-title { font-size: 16px; font-weight: 700; }
.itr-sp-alert-svc   { font-size: 13px; color: #666; margin-left: auto; }
.itr-sp-alert-msg   { margin: 0 0 10px; font-size: 14px; line-height: 1.65; }
.itr-sp-alert-meta  { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: #666; }
.itr-sp-alert-meta span { display: flex; align-items: center; gap: 4px; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.itr-sp-header { text-align: center; padding: 28px 0 20px; border-bottom: 1px solid #ebebeb; margin-bottom: 24px; }

.itr-sp-overall { display: inline-flex; align-items: center; gap: 10px; padding: 10px 22px; border-radius: 32px; font-weight: 700; font-size: 17px; margin-bottom: 16px; }
.itr-sp-overall-dot { width: 13px; height: 13px; border-radius: 50%; }
.itr-sp-overall--operational { background: #e8f5e9; color: #1b5e20; }
.itr-sp-overall--operational .itr-sp-overall-dot { background: #43a047; animation: itr-pulse 2s infinite; }
.itr-sp-overall--partial  { background: #fff8e1; color: #e65100; }
.itr-sp-overall--partial  .itr-sp-overall-dot { background: #ff9800; }
.itr-sp-overall--major    { background: #ffebee; color: #b71c1c; }
.itr-sp-overall--major    .itr-sp-overall-dot { background: #e53935; }
@keyframes itr-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(67,160,71,.4)} 50%{box-shadow:0 0 0 5px rgba(67,160,71,0)} }

/* ── Global availability bar ─────────────────────────────────────────────── */
.itr-sp-avl-global { display: inline-flex; align-items: center; gap: 10px; background: #f8f8f8; border: 1px solid #e0e0e0; border-radius: 8px; padding: 10px 18px; margin-bottom: 12px; }
.itr-sp-avl-label  { font-size: 13px; color: #555; white-space: nowrap; }
.itr-sp-avl-bar-wrap { width: 120px; height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; }
.itr-sp-avl-bar    { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #e53935 0%, #ff9800 55%, #43a047 88%); background-size: 120px; }
.itr-sp-avl-pct    { font-size: 15px; font-weight: 700; color: #1d2327; min-width: 54px; text-align: right; }

.itr-sp-intro { color: #555; margin: 4px 0 8px; font-size: 15px; }
.itr-sp-meta  { font-size: 13px; color: #aaa; } .itr-sp-meta a { color: #0073aa; }

/* ── Sections ─────────────────────────────────────────────────────────────── */
.itr-sp-section { margin-bottom: 22px; }
.itr-sp-section > h2 { font-size: 13px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 10px; }

/* ── Service rows ─────────────────────────────────────────────────────────── */
.itr-sp-service { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-radius: 8px; border: 1px solid #eee; margin-bottom: 6px; background: #fff; gap: 12px; }
.itr-sp-service--outage  { border-color: #ffcdd2; background: #fff8f8; }
.itr-sp-service--incident { border-color: #ffe0b2; background: #fffcf7; }

.itr-sp-service-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.itr-sp-service-name  { font-weight: 600; font-size: 15px; display: block; }
.itr-sp-service-desc  { font-size: 12px; color: #999; display: block; }
.itr-sp-service-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.itr-sp-service-state { font-size: 13px; color: #555; }
.itr-sp-service-meta  { font-size: 11px; color: #bbb; }
.itr-sp-latency       { font-size: 11px; color: #ccc; margin-left: 5px; }

/* ── Service availability bars ───────────────────────────────────────────── */
.itr-sp-svc-avl { display: flex; align-items: center; gap: 6px; }
.itr-sp-svc-avl-bar-wrap { width: 64px; height: 5px; background: #eee; border-radius: 3px; overflow: hidden; }
.itr-sp-svc-avl-bar { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #e53935 0%, #ff9800 55%, #43a047 88%); background-size: 64px; }
.itr-sp-svc-avl-pct { font-size: 12px; color: #888; font-weight: 600; }

/* ── Status dots ──────────────────────────────────────────────────────────── */
.itr-sp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.itr-sp-dot--operational { background: #43a047; }
.itr-sp-dot--outage      { background: #e53935; }
.itr-sp-dot--incident    { background: #ff9800; }
.itr-sp-dot--unknown     { background: #ccc; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.itr-sp-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.itr-sp-badge--critical { background: #ffcdd2; color: #b71c1c; }
.itr-sp-badge--high     { background: #ffe0b2; color: #e65100; }
.itr-sp-badge--low      { background: #bbdefb; color: #0d47a1; }
.itr-sp-badge--info     { background: #f0f0f0; color: #555; }
.itr-sp-badge--resolved { background: #c8e6c9; color: #1b5e20; }

/* ── Auto incidents ───────────────────────────────────────────────────────── */
.itr-sp-auto-incidents { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 16px 20px; }
.itr-sp-inc-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.itr-sp-inc-row:last-child { border-bottom: none; padding-bottom: 0; }
.itr-sp-inc-content { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.itr-sp-inc-svc  { font-size: 12px; color: #888; }
.itr-sp-inc-meta { font-size: 12px; color: #bbb; width: 100%; }

/* ── Source tags ──────────────────────────────────────────────────────────── */
.itr-sp-src-tag { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.itr-sp-src-manual    { background: #e3f2fd; color: #0d47a1; }
.itr-sp-src-auto      { background: #fff8e1; color: #e65100; }
.itr-sp-src-blacklist { background: #fce4ec; color: #880e4f; }

/* ── Collapsible history ──────────────────────────────────────────────────── */
.itr-sp-history-section { border: 1px solid #eee; border-radius: 8px; overflow: hidden; }
.itr-sp-history-toggle {
    width: 100%; background: #f8f8f8; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 10px; padding: 14px 20px;
    font-size: 14px; font-weight: 600; color: #444; text-align: left;
    border-radius: 8px; transition: background .15s;
}
.itr-sp-history-toggle:hover { background: #f0f0f0; }
.itr-sp-history-toggle[aria-expanded="true"] { border-radius: 8px 8px 0 0; }
.itr-sp-history-count { background: #e0e0e0; color: #555; border-radius: 10px; padding: 1px 8px; font-size: 12px; }
.itr-sp-toggle-icon { margin-left: auto; font-size: 12px; transition: transform .2s; }
.itr-sp-history-toggle[aria-expanded="true"] .itr-sp-toggle-icon { transform: rotate(90deg); }

.itr-sp-history-body { border-top: 1px solid #eee; overflow-x: auto; }
.itr-sp-history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.itr-sp-history-table th { background: #f8f8f8; padding: 8px 12px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #888; border-bottom: 1px solid #eee; }
.itr-sp-history-table td { padding: 9px 12px; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.itr-sp-history-table tr:last-child td { border-bottom: none; }

.itr-sp-toggle-avl { margin-left: 6px; font-size: 13px; font-weight: 600; color: #43a047; }

/* ── Announcement banners ─────────────────────────────────────────────────── */
.itr-sp-ann-banner { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }

.itr-sp-ann { display: flex; gap: 14px; padding: 14px 18px; border-radius: 8px; border: 1px solid; }
.itr-sp-ann--active   { background: #e3f2fd; border-color: #90caf9; }
.itr-sp-ann--upcoming { background: #f8f9fa; border-color: #dee2e6; padding: 12px 16px; }

.itr-sp-ann-icon { font-size: 20px; flex-shrink: 0; padding-top: 1px; }
.itr-sp-ann-body { flex: 1; }
.itr-sp-ann-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.itr-sp-ann-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    background: #bbdefb; color: #0d47a1; padding: 1px 7px; border-radius: 10px; }
.itr-sp-ann--upcoming .itr-sp-ann-type { background: #e9ecef; color: #495057; }
.itr-sp-ann-title { font-size: 15px; font-weight: 700; }
.itr-sp-ann-svc   { font-size: 12px; color: #888; margin-left: auto; }
.itr-sp-ann-msg   { margin: 0 0 8px; font-size: 13px; line-height: 1.55; color: #333; }
.itr-sp-ann-meta  { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #666; }

/* Upcoming section */
.itr-sp-upcoming-section { border: 1px solid #dee2e6; border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.itr-sp-upcoming-section .itr-sp-history-toggle { background: #f8f9fa; }
.itr-sp-upcoming-section #itr-upcoming-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }

/* History annotation row */
.itr-sp-history-ann td { color: #666; }
.itr-sp-ann-type-tag { font-size: 12px; }

/* ── Hint service incident link ───────────────────────────────────────────── */
.itr-sp-hint-incident { display: flex; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; color: #555; }
.itr-sp-hint-incident:hover { color: #0073aa; }
.itr-sp-hint-incident:hover .itr-sp-hint-incident-label { text-decoration: underline; }
.itr-sp-hint-incident .itr-sp-badge { flex-shrink: 0; }
.itr-sp-hint-incident-label { font-size: 12px; color: #888; }

.itr-sp-history-count--ok { background: #c8e6c9; color: #1b5e20; }

/* ── History empty state ──────────────────────────────────────────────────── */
.itr-sp-history-empty {
    display: flex; align-items: center; gap: 16px;
    padding: 20px 24px;
    background: #f1f8f2;
    border-top: 1px solid #c8e6c9;
}
.itr-sp-history-empty-icon {
    font-size: 28px; color: #43a047; flex-shrink: 0;
    width: 44px; height: 44px; border-radius: 50%;
    background: #c8e6c9; display: flex; align-items: center;
    justify-content: center; font-size: 20px;
}
.itr-sp-history-empty strong { display: block; color: #1b5e20; margin-bottom: 2px; }
.itr-sp-history-empty p { margin: 0; font-size: 13px; color: #4caf50; }

/* ── Expandable history message ───────────────────────────────────────────── */
.itr-sp-history-msg-preview { font-size: 12px; color: #888; }
.itr-sp-history-msg-full    { font-size: 12px; color: #555; display: block; margin-top: 2px; white-space: pre-wrap; }
.itr-sp-expand-btn {
    background: none; border: none; padding: 0 4px; font-size: 11px;
    color: #0073aa; cursor: pointer; text-decoration: underline;
}
.itr-sp-expand-btn:hover { color: #005177; }

/* ── Severity-specific dots (for hint services) ───────────────────────────── */
.itr-sp-dot--sev-critical { background: #e53935; }
.itr-sp-dot--sev-high     { background: #ff9800; }
.itr-sp-dot--sev-low      { background: #2196f3; }
.itr-sp-dot--sev-info     { background: #2196f3; }

/* Scroll anchor offset — lands above the element not at its bottom edge */
.itr-sp-anchor-top {
    display: block;
    position: relative;
    top: -80px;
    visibility: hidden;
    pointer-events: none;
}

/* Hint incident link color per severity */
.itr-sp-hint-sev-critical .itr-sp-hint-incident-label { color: #b71c1c; }
.itr-sp-hint-sev-high     .itr-sp-hint-incident-label { color: #e65100; }
.itr-sp-hint-sev-low      .itr-sp-hint-incident-label { color: #0d47a1; }
.itr-sp-hint-sev-info     .itr-sp-hint-incident-label { color: #0d47a1; }

/* History group headers */
.itr-sp-history-group-header td { padding: 8px 12px 6px; border-bottom: none; background: transparent; }
.itr-sp-history-group-header--first td { padding-top: 4px; }
.itr-sp-history-group-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; padding: 2px 10px;
    border-radius: 10px;
}
.itr-sp-history-group-label--monitored {
    background: #e8f0fe; color: #1a56a4;
    border-top: 2px solid #90caf9;
}
.itr-sp-history-group-label--manual {
    background: #f3f4f6; color: #6b7280;
    border-top: 2px solid #d1d5db;
}
.itr-sp-history-group-header + tr td { border-top: none; }

/* Active incident tag in history */
.itr-sp-active-tag {
    display: inline-block; padding: 1px 7px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
    background: #fff3cd; color: #856404;
}

/* ── History table → cards on mobile ─────────────────────────────────────── */
@media (max-width: 640px) {
    .itr-sp-history-table thead { display: none; }
    .itr-sp-history-table,
    .itr-sp-history-table tbody,
    .itr-sp-history-table tr,
    .itr-sp-history-table td { display: block; width: 100%; }

    .itr-sp-history-table tr {
        border: 1px solid #eee;
        border-radius: 8px;
        margin: 8px 12px;
        padding: 10px 12px;
        background: #fff;
        width: calc(100% - 24px);
        box-sizing: border-box;
    }
    .itr-sp-history-table tr.itr-sp-history-group-header {
        border: none; background: transparent;
        margin: 12px 12px 4px;
        padding: 0;
    }
    .itr-sp-history-table tr.itr-sp-history-ann {
        background: #fafafa;
    }
    .itr-sp-history-table td {
        padding: 3px 0;
        border: none;
        font-size: 13px;
    }
    /* Hide "Ende" cell when empty (—) to save space */
    .itr-sp-history-table td:last-child:not(:only-child) {
        color: #888; font-size: 12px;
    }
    /* Label each cell */
    .itr-sp-history-table td:nth-child(1)::before { content: ''; }
    .itr-sp-history-table td:nth-child(2)::before { content: 'Dienst: '; font-weight: 600; color: #555; font-size: 12px; }
    .itr-sp-history-table td:nth-child(3)::before { content: ''; }
    .itr-sp-history-table td:nth-child(4)::before { content: 'Status: '; font-weight: 600; color: #555; font-size: 12px; }
    .itr-sp-history-table td:nth-child(5)::before { content: 'Start: '; font-weight: 600; color: #555; font-size: 12px; }
    .itr-sp-history-table td:nth-child(6)::before { content: 'Ende: '; font-weight: 600; color: #555; font-size: 12px; }

    /* Group header spanning full width */
    .itr-sp-history-group-header td { padding: 4px 0 !important; }
}

/* ── Hint service separator ───────────────────────────────────────────────── */
.itr-sp-service-separator {
    display: flex; align-items: center; gap: 10px;
    margin: 18px 0 10px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: #bbb;
}
.itr-sp-service-separator::before,
.itr-sp-service-separator::after {
    content: ''; flex: 1; height: 1px; background: #eee;
}
.itr-sp-hint-state { color: #bbb; font-size: 12px; }
.itr-sp-dot--hint { background: #ddd; }
.itr-sp-service--hint { border-color: #f0f0f0; background: #fafafa; }
.itr-sp-service--hint .itr-sp-service-name { color: #666; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.itr-sp-footer { text-align: center; padding: 18px 0 0; font-size: 12px; color: #ccc; }
.itr-sp-footer a { color: #ccc; text-decoration: none; }
.itr-sp-footer a:hover { color: #0073aa; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .itr-sp-alert { flex-direction: column; gap: 10px; }
    .itr-sp-service { flex-direction: column; align-items: flex-start; }
    .itr-sp-service-right { align-items: flex-start; }
    .itr-sp-avl-global { flex-direction: column; gap: 6px; }
    .itr-sp-history-table { font-size: 12px; }
}
