:root {
  --primary: #0fb9b1;
  --primary2: rgb(185, 15, 15);
  --primary-dark: #0a8f89;

  --bg: radial-gradient(circle at top, #141824, #0b0d12);
  --panel: #181b21;
  --card: rgba(255, 255, 255, 0.04);
  --card2: rgba(0, 0, 0, 0.25);
  --border: rgba(255, 255, 255, 0.1);
  /* --border: rgba(0, 128, 128, 0.45); */
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.65);

  --ok: #3aff9e;
  --warn: #ffd36a;
  --err: #ff7b7b;

  --shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial;
  background:
    radial-gradient(
      900px 500px at 20% 0%,
      rgba(15, 185, 177, 0.18),
      transparent 55%
    ),
    radial-gradient(
      900px 500px at 80% 20%,
      rgba(122, 162, 247, 0.12),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 50% 100%,
      rgba(255, 211, 106, 0.08),
      transparent 60%
    ),
    var(--bg);
  color: var(--text);
}

.wrap > .top {
  margin-top: 10px;
}

main.wrap {
  padding-top: calc(var(--topbar-height) + 24px);
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
  opacity: 0.9;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 26px auto;
  padding-bottom: 34px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.title {
  font-weight: 900;
  letter-spacing: 0.2px;
  font-size: 22px;
}
.sub {
  margin-top: 4px;
}

.right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
}

.card {
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 14px;
  overflow: hidden;
}

.banner {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.24);
  font-weight: 900;
  letter-spacing: 0.2px;
  text-align: center;
  margin-bottom: 14px;
}
.banner.ok {
  box-shadow: 0 0 0 1px rgba(58, 255, 158, 0.15) inset;
}
.banner.warn {
  box-shadow: 0 0 0 1px rgba(255, 211, 106, 0.16) inset;
}
.banner.err {
  box-shadow: 0 0 0 1px rgba(255, 123, 123, 0.16) inset;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.svc {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  padding: 12px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.svc-name {
  font-weight: 900;
}
.svc-desc {
  font-size: 12px;
  margin-top: 3px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 900;
  white-space: nowrap;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}
.dot.ok {
  background: var(--ok);
}
.dot.warn {
  background: var(--warn);
}
.dot.err {
  background: var(--err);
}

.meta {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-row {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.chart-wrap {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  padding: 12px;
}
#historyChart {
  width: 100%;
  height: 120px;
  display: block;
}

.svc-sub {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.9;
}

.incidents {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  padding: 12px;
  min-height: 52px;
}

.incidents {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}

.incidents::-webkit-scrollbar {
  width: 10px;
}
.incidents::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.2);
}
.incidents::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}

.inc-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.inc-line:last-child {
  border-bottom: 0;
}
.inc-badge {
  font-weight: 900;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}
.inc-badge.ok {
  color: var(--ok);
  border-color: rgba(58, 255, 158, 0.25);
}
.inc-badge.warn {
  color: var(--warn);
  border-color: rgba(255, 211, 106, 0.25);
}
.inc-badge.err {
  color: var(--err);
  border-color: rgba(255, 123, 123, 0.25);
}

.foot {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .meta {
    grid-template-columns: 1fr;
  }
  .right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

.topbar,
footer {
  position: relative;
  z-index: 1;
}

/* --------------------------
   TOPBAR / NAVBAR STYLING
   -------------------------- */

.topbar {
  overflow: visible; /* WICHTIG */
  z-index: 20;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: rgba(11, 13, 18, 0.65);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 185, 177, 0.3);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  z-index: 10;
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.25s ease;
}

.topbar:hover {
  background: rgba(11, 13, 18, 0.8);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}

.logo {
  font-weight: 800;
  font-size: 20px;
  color: var(--primary);
  text-shadow: 0 0 8px rgba(15, 185, 177, 0.5);
  transition:
    color 0.3s ease,
    text-shadow 0.3s ease;
}

.logo:hover {
  color: #00fff6;
  text-shadow: 0 0 12px rgba(0, 255, 246, 0.7);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(15, 185, 177, 0.25);
  background: rgba(255, 255, 255, 0.03);
  object-fit: cover;
}
.brand-name {
  font-weight: 900;
  color: var(--primary);
}
.brand-tag {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.9;
}
@media (max-width: 768px) {
  .brand-tag {
    display: none;
  }
}

nav a {
  margin-left: 22px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

/* Hamburger (injected via assets/public.js) */
.nav-hamburger {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(15, 185, 177, 0.35);
  background: rgba(11, 13, 18, 0.45);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.nav-hamburger:hover {
  transform: translateY(-1px);
  background: rgba(11, 13, 18, 0.75);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  transition: transform 180ms ease;
}

nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition:
    width 0.3s ease,
    left 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
  left: 0;
}

nav a:hover {
  color: var(--primary);
  background: rgba(15, 185, 177, 0.08);
  box-shadow: 0 4px 12px rgba(15, 185, 177, 0.2);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .topbar {
    height: auto;
    padding: 12px 14px;
  }

  .logo {
    font-size: 18px;
  }

  .nav-hamburger {
    display: inline-flex;
  }

  /* Collapsed by default */
  .topbar nav {
    display: none;
    width: 100%;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(15, 185, 177, 0.22);
  }

  .topbar.nav-open nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .topbar nav a {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
}

/* =============================
   NAV DROPDOWN
   ============================= */

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown .nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Dropdown Grundzustand: versteckt */
.navbar .dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
}

/* Dropdown erst bei Hover auf dem Menüpunkt anzeigen */
.navbar .dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown .caret {
  font-size: 12px;
  opacity: 0.7;
  transition: transform 0.25s ease;
}

/* Dropdown Box */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 200px;
  background: rgba(11, 13, 18, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(15, 185, 177, 0.25);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  padding: 8px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 50;
}

/* Links im Dropdown */
.dropdown-menu a {
  display: block;
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.dropdown-menu a:hover {
  background: rgba(15, 185, 177, 0.12);
  color: var(--primary);
  transform: none;
  box-shadow: none;
}

/* Hover öffnen */
.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown:hover .caret {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .nav-dropdown {
    width: 100%;
    justify-content: center;
  }

  .dropdown-menu {
    /* On touch devices we don't use :hover. Collapse by default and open via JS
       by adding .open to .nav-dropdown. */
    position: static;
    transform: none;
    opacity: 1; /* keep readable once opened */
    margin-top: 6px;
    box-shadow: none;
    background: rgba(15, 185, 177, 0.06);

    max-height: 0;
    overflow: hidden;
    padding: 0;
    pointer-events: none;
    transition:
      max-height 0.25s ease,
      padding 0.25s ease;
  }

  .nav-dropdown.open .dropdown-menu {
    max-height: 520px;
    padding: 8px;
    pointer-events: auto;
  }

  .nav-dropdown.open .caret {
    transform: rotate(180deg);
  }
}

.dropdown-menu {
  z-index: 999;
}
.nav-dropdown {
  pointer-events: auto;
}

.dropdown-menu {
  pointer-events: auto;
}

.music-widget {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(11, 13, 18, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(15, 185, 177, 0.35);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  transition: transform 180ms ease;
}

.music-btn {
  border: none;
  background: rgba(15, 185, 177, 0.12);
  border: 1px solid rgba(15, 185, 177, 0.35);
  color: var(--primary);
  width: 38px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
}

.music-btn:hover {
  transform: translateY(-1px);
}

.music-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
}

.music-slider-wrap input[type="range"] {
  width: 110px;
}

#musicVolLabel {
  font-size: 12px;
  opacity: 0.75;
  min-width: 36px;
  text-align: right;
}

footer {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
  letter-spacing: 0.2px;
  margin-top: auto;
  background: rgba(11, 13, 18, 0.75);
  backdrop-filter: blur(10px);
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 6px;
  font-size: 13px;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer:hover .footer-brand {
  text-shadow: 0 0 8px rgba(15, 185, 177, 0.25);
}

.footer-brand {
  color: var(--primary);
  font-weight: 600;
}

.footer-sep {
  margin: 0 6px;
  opacity: 0.4;
}

.footer-copy {
  color: #94a3b8;
}

.footer-year {
  color: rgba(255, 255, 255, 0.45);
  text-shadow: 0 0 8px rgba(15, 185, 177, 0.25);
}

/* --------------------------
   SMOOTH BACKGROUND
   -------------------------- */
.nebula {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 185, 177, 0.2), transparent 70%);
  filter: blur(180px);
  pointer-events: none;
  z-index: 0;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.nebula1 {
  top: -200px;
  left: -100px;
  width: 700px;
  height: 700px;
  animation: floatNebula1 80s infinite;
  opacity: 0.7;
}

.nebula2 {
  bottom: -250px;
  left: 50px;
  width: 600px;
  height: 600px;
  animation: floatNebula2 100s infinite;
  opacity: 0.6;
}

.nebula3 {
  top: 20%;
  left: 40%;
  width: 800px;
  height: 800px;
  animation: floatNebula3 120s infinite;
  opacity: 0.5;
}

.nebula4 {
  top: 50%;
  right: 20%;
  width: 650px;
  height: 650px;
  animation: floatNebula4 90s infinite;
  opacity: 0.55;
}

.nebula5 {
  bottom: 10%;
  right: 10%;
  width: 750px;
  height: 750px;
  animation: floatNebula5 110s infinite;
  opacity: 0.6;
}

/* --------------------------
   SMOOTH ANIMATIONS
   -------------------------- */
@keyframes floatNebula1 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(-50px, 30px) scale(1.05);
  }
  50% {
    transform: translate(-80px, 60px) scale(1.1);
  }
  75% {
    transform: translate(-30px, 20px) scale(1.08);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes floatNebula2 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(40px, -30px) scale(1.03);
  }
  50% {
    transform: translate(60px, -50px) scale(1.06);
  }
  75% {
    transform: translate(20px, -20px) scale(1.04);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes floatNebula3 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(-20px, 40px) scale(1.04);
  }
  50% {
    transform: translate(-40px, 80px) scale(1.07);
  }
  75% {
    transform: translate(-10px, 30px) scale(1.05);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes floatNebula4 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -50px) scale(1.03);
  }
  50% {
    transform: translate(50px, -70px) scale(1.06);
  }
  75% {
    transform: translate(20px, -30px) scale(1.04);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes floatNebula5 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(-60px, 40px) scale(1.05);
  }
  50% {
    transform: translate(-80px, 60px) scale(1.08);
  }
  75% {
    transform: translate(-40px, 20px) scale(1.06);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}
