/* ─── Variables ─────────────────────────────────────────── */
:root {
  --sidebar-w: 280px;
  --nav-h: 56px;
  --green: #20c997;
  --green-dark: #198754;
  --sidebar-bg: #f8f9fa;
  --card-border: #e9ecef;
  --body-bg: #fff;
  --card-bg: #fff;
  --card-bg-muted: #f8f9fa;
  --text-primary: #212529;
  --text-secondary: #495057;
  --intro-color: #444;
}

[data-bs-theme="dark"] {
  --sidebar-bg: #1e2226;
  --card-border: #2e3338;
  --body-bg: #212529;
  --card-bg: #2b3035;
  --card-bg-muted: #1e2226;
  --text-primary: #f0f2f4;
  --text-secondary: #adb5bd;
  --intro-color: #ced4da;
}

/* ─── Particle background ────────────────────────────────── */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}
[data-bs-theme="dark"] .bg-canvas { background: #0d1117; }
[data-bs-theme="light"] .bg-canvas { background: #f0fdf8; }
.bg-canvas canvas { display: block; width: 100%; height: 100%; }

body.particles-page { background: transparent; }
body.particles-page .portal-main { background: transparent; }

/* smooth theme transition */
body,
.portal-main,
.portal-sidebar,
.metric-card,
.metric-card-sm,
.section-card,
.step-card,
.threshold-card,
.frame-toolbar,
.news-card {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.15s ease;
}

/* ─── Navbar logo ───────────────────────────────────────── */
.navbar-logo {
  height: 36px;
  width: auto;
}

/* ─── Footer ────────────────────────────────────────────── */
.portal-footer {
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: #adb5bd;
  background: #212529;
  border-top: 1px solid #343a40;
  flex-shrink: 0;
}
.portal-footer a {
  color: #adb5bd;
  text-decoration: none;
}
.portal-footer a:hover {
  color: #fff;
  text-decoration: underline;
}
.portal-footer .sep {
  margin: 0 0.5rem;
}

/* ─── Portal shell ──────────────────────────────────────── */
.portal-wrapper {
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
}

.portal-main {
  overflow-y: auto;
  background: var(--body-bg);
}

/* Frame mode: no scroll, children fill height */
.portal-main.frame-mode {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ─── Sidebar ───────────────────────────────────────────── */
.portal-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-left: 1px solid var(--card-border);
  overflow-y: auto;
  padding: 1rem 0.875rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-heading {
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  color: #6c757d;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.sidebar-section {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--card-border);
}

.sidebar-section:last-of-type {
  border-bottom: none;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.72rem;
  border-top: 1px solid var(--card-border);
}

/* ─── Metric cards ──────────────────────────────────────── */
.metric-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 0.65rem 0.875rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.metric-label {
  font-size: 0.72rem;
  color: #6c757d;
  margin-top: 0.1rem;
}

/* Smaller dual metrics */
.metric-card-sm {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 0.5rem 0.5rem;
  border: 1px solid var(--card-border);
}

.metric-value-sm {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.metric-label-sm {
  font-size: 0.65rem;
  color: #6c757d;
}

/* ─── Status dots ───────────────────────────────────────── */
.status-item { min-width: 0; }

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-up          { background: #20c997; box-shadow: 0 0 5px rgba(32,201,151,.55); }
.status-down        { background: #dc3545; box-shadow: 0 0 5px rgba(220,53,69,.4); }
.status-maintenance { background: #fd7e14; }
.status-dot:not(.status-up):not(.status-down):not(.status-maintenance) { background: #adb5bd; }

.status-name {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ─── Frame layout ──────────────────────────────────────── */
.frame-container {
  height: 100%;
}

.frame-toolbar {
  background: var(--card-bg-muted);
  border-bottom: 1px solid var(--card-border);
  font-size: 0.82rem;
  flex-shrink: 0;
  min-height: 42px;
}

.frame-body {
  min-height: 0;
}

.frame-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 2rem;
  color: #6c757d;
}

/* ─── Home + Transparenz (volle Breite im Hauptbereich) ─── */
.home-content {
  max-width: 980px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.hero-section {
  padding-top: 0.5rem;
}

.intro-text {
  font-size: 1.05rem;
  color: var(--intro-color);
  line-height: 1.7;
}

.section-title {
  font-weight: 700;
  color: var(--text-primary);
}

/* Hero icon decoration */
.hero-icon-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg-icon {
  font-size: 9rem;
  color: var(--green);
  opacity: 0.12;
  position: absolute;
}

.hero-icon-overlay {
  position: relative;
  font-size: 3.5rem;
  color: var(--green);
}

/* ─── Feature grid ──────────────────────────────────────── */
.section-card {
  background: var(--card-bg-muted);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--card-border);
}

.feature-item {
  text-align: center;
  padding: 1rem;
}

.feature-icon {
  font-size: 2.2rem;
  color: var(--green);
  margin-bottom: 0.75rem;
  line-height: 1;
}

/* ─── Step cards ────────────────────────────────────────── */
.step-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1.25rem 1.25rem 1.25rem 1.25rem;
  padding-top: 2.75rem;
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.step-number {
  position: absolute;
  top: -14px;
  left: 1.25rem;
  width: 30px;
  height: 30px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(32,201,151,.4);
}

/* ─── News cards ────────────────────────────────────────── */
.news-card {
  border: 1px solid var(--card-border);
  transition: box-shadow 0.15s, border-color 0.15s;
  border-radius: 8px;
}

.news-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.09);
  border-color: #c0c8d0;
}

/* ─── FAQ accordion ─────────────────────────────────────── */
.accordion-button:not(.collapsed) {
  background-color: #f0fdf8;
  color: #135e46;
  box-shadow: none;
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
  background-color: #1a3a2e;
  color: #6eddbf;
}

.accordion-button:focus {
  box-shadow: 0 0 0 3px rgba(32,201,151,.2);
}

.accordion-item {
  border-radius: 8px !important;
  overflow: hidden;
}

/* ─── Transparency threshold cards ─────────────────────── */
.threshold-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1rem 1.1rem 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.threshold-title {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
}

.threshold-portnum-label {
  font-size: 0.68rem;
  color: #adb5bd;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  margin-top: 0.1rem;
  margin-left: 1.85rem;
}

.threshold-section-head {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6c757d;
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
}

.threshold-limits {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.threshold-limit-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
  border-bottom: 1px dashed var(--card-border);
  padding-bottom: 0.2rem;
}

.threshold-limit-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.threshold-key {
  color: #6c757d;
}

.threshold-val {
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: 0.5rem;
}

/* ─── Admin ─────────────────────────────────────────────── */
.font-monospace {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875rem;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .portal-sidebar {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .home-content {
    padding: 1rem !important;
  }
  .metric-value {
    font-size: 1.4rem;
  }
}
