* {
  box-sizing: border-box;
}
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.server-card {
  background: #0f172a;
  border-radius: 12px;
  padding: 16px;
}

.toggle.disabled {
  pointer-events: none;
  opacity: 0.6;
}

body {
  margin: 0;
  background: #0e0e10;
  color: #fff;
  font-family: Inter, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.footer {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #333;
    opacity: 0.75;
    z-index: 9999;
    pointer-events: none; /* Seite bleibt klickbar */
    background: rgba(255,255,255,0.8);
    padding: 4px 12px;
    border-radius: 14px;
    font-weight: bold;
    backdrop-filter: blur(4px);
}

.footer .heart {
    color: #e25555;
    font-weight: bold;
}

.footer a {
    color: inherit;
    text-decoration: none;
    pointer-events: auto; /* NUR der Link ist klickbar */
}

.footer a:hover {
    text-decoration: underline;
}

/* === BRB TOGGLE – original style, scaled down & fixed === */

.toggle {
  position: relative;
  margin: 25px auto 218px;
  width: 48px;
  height: 48px;
}

/* Checkbox ausblenden */
.toggle input {
  display: none;
}

/* === BUTTON === */
.toggle label {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  background-color: #FD1015;
  border-radius: 50%;
  cursor: pointer;
  box-shadow:
    inset 0 0 2px rgba(0,0,0,0.15),
    0 6px 10px rgba(239,66,71,0.5);
  -webkit-tap-highlight-color: transparent;
}

/* Inner Ring */
.toggle label::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  background-color: #fd0f14;
  border-radius: 50%;
  box-shadow: inset 0 0 0 6px #fff;
  transition: width 0.2s cubic-bezier(0, -1.85, .27, 1.75);
}

/* === ON STATE === */
.toggle input:checked + label {
  background-color: #57de72;
  box-shadow:
    inset 0 0 2px rgba(0,0,0,0.15),
    0 6px 10px rgba(3,132,28,0.45);
}

.toggle input:checked + label::before {
  width: 6px;
  background-color: #fff;
}

/* === OFF / ON TEXT === */
.toggle::before {
  content: "OFF";
  position: absolute;
  left: -34px;
  top: 16px;
  font-size: 12px;
  color: #fff;
}

.toggle::after {
  content: "ON";
  position: absolute;
  right: -28px;
  top: 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.25);
}

.toggle.on::before {
  color: rgba(255,255,255,0.25);
}

.toggle.on::after {
  color: #fff;
}

/* === SAVING STATE (wichtig) === */
.toggle.saving label {
  filter: grayscale(1);
  opacity: 0.6;
  cursor: wait;
}

/* === SAVING TEXT (schwebend, KEIN Layout-Effekt) === */
.toggle .toggle-status {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #fff;
  opacity: 0.85;
  white-space: nowrap;
  pointer-events: none;
  display: none;
}

.toggle.saving .toggle-status {
  display: block;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

details summary {
  cursor: pointer;
  font-size: 1.05em;
}
details[open] summary {
  color: #22c55e;
}

/* ===== Buttons ===== */
.btn {
  background: #9146FF;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  padding: 14px 30px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:hover {
  background: #772ce8;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #3a3a3d;
}

.btn-secondary:hover {
  background: #4a4a50;
}

/* ===== Layout ===== */
.centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.card {
  background: #18181b;
  border-radius: 14px;
  padding: 40px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}

.card h1 {
  margin-top: 0;
  font-size: 2rem;
}

.card p {
  color: #b9b9c3;
  line-height: 1.6;
}

/* ===== Dashboard ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.copy-box {
  cursor: pointer;
  user-select: none;
  position: relative;
}

/* Copy-Feedback Tooltip */
.copy-box::after {
  content: "Kopiert ✓";
  position: absolute;
  top: -28px;
  right: 10px;
  background: #22c55e;
  color: #000;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.copy-box.copied::after {
  opacity: 1;
  transform: translateY(0);
}

.box {
    border-color: #000;
    border: 1px solid #9146FF;
    background: #18181b;
    border-radius: 14px;
    padding: 24px;
}

.box h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.file-upload {
  margin-top: 10px;
}

.file-upload input[type="file"] {
  display: none;
}

.file-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 10px;
  background: #3a3a3d;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 1rem;
}

.file-label:hover {
  background: #4a4a50;
}

.file-name {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #b9b9c3;
}

.mono {
  font-family: monospace;
  background: #0e0e10;
  padding: 10px;
  border-radius: 8px;
  word-break: break-all;
  font-size: 0.95rem;
}


.status {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* OFFLINE = rot */
.status.offline {
  background: #dc2626;
  color: #fff;
}

/* ONLINE = grün */
.status.live {
  background: #22c55e;
  color: #000;
}

/* BRB = gelb */
.status.brb {
  background: #facc15;
  color: #000;
}

input[type="file"] {
  margin-top: 10px;
}

/* =========================
   Admin Panel – User Tabelle
   ========================= */

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.95rem;
}

.table thead th,
.table tbody td {
  padding: 8px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table thead th {
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-weight: 600;
}

.table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

/* =========================
   SPALTEN – EXAKT PASSEND
   ========================= */

/* 1️⃣ Twitch */
.table th:nth-child(1),
.table td:nth-child(1) {
  width: 160px;
}

/* 2️⃣ Twitch ID */
.table th:nth-child(2),
.table td:nth-child(2) {
  width: 110px;
  text-align: center;
}

/* 3️⃣ Stream Key (nimmt Restbreite!) */
.table th:nth-child(3),
.table td:nth-child(3) {
  width: auto;
}

/* 4️⃣ Stream Status (LIVE / OFFLINE) */
.table th:nth-child(4),
.table td:nth-child(4) {
  width: 110px;
  text-align: center;
}

/* 5️⃣ Bitrate */
.table th:nth-child(5),
.table td:nth-child(5) {
  width: 90px;
  text-align: right;
}

/* 6️⃣ Status (Aktiv + Button) */
.table th:nth-child(6),
.table td:nth-child(6) {
  width: 170px;
}

/* 7️⃣ BRB */
.table th:nth-child(7),
.table td:nth-child(7) {
  width: 60px;
  text-align: center;
}

/* 8️⃣ Erstellt */
.table th:nth-child(8),
.table td:nth-child(8) {
  width: 150px;
}

/* =========================
   Stream Status Badge
   ========================= */

.stream-status {
  display: inline-block;
  min-width: 90px;
  padding: 6px 0;
  font-size: 0.75rem;
  border-radius: 999px;
  text-align: center;
}

.status.live    { background:#22c55e; color:#000; }
.status.brb     { background:#facc15; color:#000; }
.status.offline { background:#dc2626; color:#fff; }

/* =========================
   Bitrate
   ========================= */

.bitrate {
  font-family: monospace;
  font-size: 0.85rem;
  opacity: 0.9;
}

/* =========================
   Aktiv / Gesperrt
   ========================= */

.status-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-label {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.status-label.active {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}

.status-label.inactive {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}

.status-btn {
  width: 84px;
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: #aaa;
  cursor: pointer;
}

.status-btn:hover {
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}

/* =========================
   Twitch Link
   ========================= */

.twitch-link {
  color: inherit;
  text-decoration: none;
}

.twitch-link:hover {
  text-decoration: underline;
}

/* Stream Key monospace */
.mono {
  font-family: monospace;
  font-size: 0.85rem;
}
