/* ============================================================================
   RACK26 Status Page — Stylesheet
   ============================================================================ */

/* ── Custom Properties ──────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --brand-primary: #0050b3;
  --brand-accent:  #7a06fe;  /* RACK26 orange accent */

  /* Backgrounds */
  --bg-page:       #f0f4f8;
  --bg-card:       #ffffff;
  --bg-header:     #0a1628;

  /* Borders & Shadows */
  --border-color:  #dce3ed;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
  --shadow-md:     0 4px 12px rgba(0,0,0,.08);

  /* Typography */
  --text-primary:  #0f172a;
  --text-secondary:#4b5a6e;
  --text-muted:    #7a8799;
  --font:          'Archivo', system-ui, -apple-system, sans-serif;

  /* Radius */
  --radius:        10px;
  --radius-sm:     6px;
  --radius-xs:     4px;

  /* Status colours */
  --c-ok:          #16a34a;
  --c-ok-bg:       #f0fdf4;
  --c-ok-border:   #bbf7d0;
  --c-ok-dot:      #22c55e;

  --c-dis:         #b45309;
  --c-dis-bg:      #fffbeb;
  --c-dis-border:  #fde68a;
  --c-dis-dot:     #f59e0b;

  --c-out:         #b91c1c;
  --c-out-bg:      #fff1f2;
  --c-out-border:  #fecdd3;
  --c-out-dot:     #ef4444;

  --c-maint:       #4338ca;
  --c-maint-bg:    #eef2ff;
  --c-maint-border:#c7d2fe;
  --c-maint-dot:   #818cf8;
}

/* ── Reset / Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid rgba(255,255,255,.07);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.01em;
}

.logo:hover { text-decoration: none; }

.logo-rack { color: #ffffff; }
.logo-num  { color: var(--brand-accent); }

.logo-divider {
  color: rgba(255,255,255,.3);
  font-weight: 300;
  font-size: 1rem;
  margin: 0 2px;
}

.logo-status {
  font-size: .85rem;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  letter-spacing: .02em;
}

.header-meta {
  font-size: .8rem;
  color: rgba(255,255,255,.45);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ── Overall Status Banner ──────────────────────────────────────────────────── */
.overall-banner {
  padding: 28px 0;
  border-bottom: 1px solid var(--border-color);
}

.overall-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.overall-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.overall-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.overall-text p {
  font-size: .9rem;
  margin-top: 2px;
}

/* Colour variants */
.overall-operational {
  background: var(--c-ok-bg);
  border-bottom-color: var(--c-ok-border);
}
.overall-operational .overall-icon {
  background: #dcfce7;
  color: var(--c-ok);
}
.overall-operational .overall-text h1 { color: #14532d; }
.overall-operational .overall-text p  { color: #166534; }

.overall-disruption {
  background: var(--c-dis-bg);
  border-bottom-color: var(--c-dis-border);
}
.overall-disruption .overall-icon {
  background: #fef3c7;
  color: var(--c-dis);
}
.overall-disruption .overall-text h1 { color: #78350f; }
.overall-disruption .overall-text p  { color: #92400e; }

.overall-outage {
  background: var(--c-out-bg);
  border-bottom-color: var(--c-out-border);
}
.overall-outage .overall-icon {
  background: #ffe4e6;
  color: var(--c-out);
}
.overall-outage .overall-text h1 { color: #7f1d1d; }
.overall-outage .overall-text p  { color: #991b1b; }

.overall-maintenance {
  background: var(--c-maint-bg);
  border-bottom-color: var(--c-maint-border);
}
.overall-maintenance .overall-icon {
  background: #e0e7ff;
  color: var(--c-maint);
}
.overall-maintenance .overall-text h1 { color: #1e1b4b; }
.overall-maintenance .overall-text p  { color: #312e81; }

/* ── Main Content ───────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 32px 0 48px;
}

.section {
  margin-bottom: 36px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  font-size: .9rem;
  opacity: .7;
}

/* ── Status Badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-operational {
  color: var(--c-ok);
  background: var(--c-ok-bg);
  border-color: var(--c-ok-border);
}
.badge-operational .badge-dot {
  background: var(--c-ok-dot);
  box-shadow: 0 0 0 2px rgba(34,197,94,.25);
}

.badge-disruption {
  color: var(--c-dis);
  background: var(--c-dis-bg);
  border-color: var(--c-dis-border);
}
.badge-disruption .badge-dot {
  background: var(--c-dis-dot);
  box-shadow: 0 0 0 2px rgba(245,158,11,.25);
}

.badge-outage {
  color: var(--c-out);
  background: var(--c-out-bg);
  border-color: var(--c-out-border);
}
.badge-outage .badge-dot {
  background: var(--c-out-dot);
  box-shadow: 0 0 0 2px rgba(239,68,68,.25);
}

.badge-maintenance {
  color: var(--c-maint);
  background: var(--c-maint-bg);
  border-color: var(--c-maint-border);
}
.badge-maintenance .badge-dot {
  background: var(--c-maint-dot);
  box-shadow: 0 0 0 2px rgba(129,140,248,.25);
}

/* ── Rechenzentren Grid ─────────────────────────────────────────────────────── */
.component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}

.component-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease;
}

.component-card:hover { box-shadow: var(--shadow-md); }

.component-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.component-dc-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
}

.component-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.component-name {
  font-weight: 600;
  font-size: .92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.component-sub {
  font-size: .78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.component-note {
  font-style: italic;
}

/* ── Dienste List ───────────────────────────────────────────────────────────── */
.service-list {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background .1s ease;
}

.service-item:last-child { border-bottom: none; }
.service-item:hover { background: #f8fafc; }

.service-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.service-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
}

.service-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.service-name {
  font-weight: 500;
  font-size: .92rem;
  color: var(--text-primary);
}

.service-note {
  font-size: .78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Incident Cards ─────────────────────────────────────────────────────────── */
.incidents-list,
.incident-card + .incident-card {
  margin-top: 16px;
}

.incident-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.incident-card.incident-active {
  border-left: 4px solid var(--c-dis-dot);
}
.incident-card.incident-active.incident-outage {
  border-left-color: var(--c-out-dot);
}

.incident-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-color);
}

.incident-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.incident-severity {
  flex-shrink: 0;
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.severity-disruption {
  background: var(--c-dis-bg);
  color: var(--c-dis);
  border: 1px solid var(--c-dis-border);
}
.severity-outage {
  background: var(--c-out-bg);
  color: var(--c-out);
  border: 1px solid var(--c-out-border);
}
.severity-maintenance {
  background: var(--c-maint-bg);
  color: var(--c-maint);
  border: 1px solid var(--c-maint-border);
}
.severity-info {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.incident-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.incident-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.incident-date {
  font-size: .78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.incident-state {
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.state-investigating { background: #fef3c7; color: #b45309; }
.state-identified    { background: #fff7ed; color: #c2410c; }
.state-monitoring    { background: #eff6ff; color: #1d4ed8; }
.state-resolved      { background: #f0fdf4; color: #15803d; }

/* ── Incident Timeline ──────────────────────────────────────────────────────── */
.incident-timeline {
  padding: 8px 0;
}

.timeline-item {
  display: flex;
  gap: 0;
  padding: 12px 18px;
  position: relative;
}

.timeline-item + .timeline-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: var(--border-color);
}

.timeline-marker {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  margin-right: 14px;
  border: 2px solid;
}

.timeline-item.state-investigating .timeline-marker { background: #fef3c7; border-color: var(--c-dis-dot); }
.timeline-item.state-identified    .timeline-marker { background: #fff7ed; border-color: #fb923c; }
.timeline-item.state-monitoring    .timeline-marker { background: #dbeafe; border-color: #60a5fa; }
.timeline-item.state-resolved      .timeline-marker { background: #dcfce7; border-color: var(--c-ok-dot); }

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.timeline-time {
  font-size: .78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.timeline-state {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.timeline-item.state-investigating .timeline-state { color: var(--c-dis); }
.timeline-item.state-identified    .timeline-state { color: #c2410c; }
.timeline-item.state-monitoring    .timeline-state { color: #1d4ed8; }
.timeline-item.state-resolved      .timeline-state { color: var(--c-ok); }

.timeline-text {
  font-size: .87rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── No Incidents Placeholder ───────────────────────────────────────────────── */
.no-incidents {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: .9rem;
  box-shadow: var(--shadow-sm);
}

.no-incidents i {
  font-size: 1.8rem;
  color: var(--c-ok);
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-header);
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 20px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: .8rem;
  color: rgba(255,255,255,.35);
}

.footer-nav {
  display: flex;
  gap: 20px;
}

.footer-nav a {
  font-size: .8rem;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  transition: color .15s ease;
}

.footer-nav a:hover {
  color: rgba(255,255,255,.8);
  text-decoration: none;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 0 16px; }

  .header-inner { height: 56px; }
  .logo { font-size: 1.1rem; }
  .logo-status { display: none; }
  .header-meta { font-size: .72rem; }

  .overall-banner { padding: 20px 0; }
  .overall-icon   { width: 44px; height: 44px; font-size: 1.2rem; }
  .overall-text h1 { font-size: 1.05rem; }

  .main-content { padding: 24px 0 40px; }
  .section { margin-bottom: 28px; }

  .component-grid {
    grid-template-columns: 1fr;
  }

  .component-card {
    padding: 14px 14px;
  }

  .incident-header {
    flex-direction: column;
    gap: 10px;
  }

  .incident-badges {
    align-self: flex-start;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }
}

@media (max-width: 400px) {
  .component-card-left { gap: 10px; }
  .component-dc-icon   { width: 32px; height: 32px; font-size: .8rem; }
  .service-icon        { width: 28px; height: 28px; font-size: .75rem; }
}

/* ── Accessibility ──────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
