/* Astro – gemeinsames Design für Admin und öffentliche Seite (Farben, Schrift, Grundbausteine).
   Admin: /static/public/base.css, öffentlich: /static/base.css – danach folgt das jeweilige Seiten-Stylesheet. */
:root {
  --bg: #06080d; --bg2: #0b0f17; --panel: #10151f; --panel2: #171e2b; --line: #212a3a;
  --text: #e6ebf4; --muted: #8d98ab; --faint: #5f6a7e;
  --accent: #9db4ff; --accent-ink: #0a0d16; --accent2: #ffcf8a;
  --green: #3ccf7a; --yellow: #f2c14e; --red: #ef5b5b; --like: #ff6b8b;
  --radius: 14px; --radius-sm: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --card: var(--panel);
  color-scheme: dark;
}
/* Rotlicht-Modus (Nachtsicht, nur Admin) */
body.red {
  --bg: #0a0000; --bg2: #0d0101; --panel: #140202; --panel2: #1c0404; --line: #3a0a0a;
  --text: #ff5a4a; --muted: #a0382e; --faint: #6e241d; --accent: #ff3b2f; --accent-ink: #000; --accent2: #ff5a4a;
  --green: #ff5a4a; --yellow: #c8382c; --red: #7a1a14;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
input, select, textarea, button { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
::placeholder { color: var(--muted); opacity: .8; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: var(--mono); background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; color: var(--text); }
.mono { font-family: var(--mono); }
h1, h2, h3 { letter-spacing: -.01em; }
h2 small { color: var(--muted); font-weight: 400; margin-left: 8px; font-size: .85em; }
.hint { color: var(--muted); font-size: .85rem; margin: 8px 0 0; }

/* Knöpfe */
.ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 12px; text-decoration: none; transition: border-color .15s, background .15s; }
.ghost:hover { border-color: var(--accent); text-decoration: none; }
.ghost.sm { padding: 4px 10px; font-size: .85rem; }
.ghost.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: var(--radius-sm); padding: 8px 18px; font-weight: 600; text-decoration: none; }
.primary:hover { filter: brightness(1.08); }
.primary:disabled, .ghost:disabled { opacity: .45; cursor: not-allowed; }

/* Chips / Filter */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.chips button { background: var(--panel2); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-size: .82rem; color: var(--text); }
.chips button.active, .chips button.on, .chips button:hover { border-color: var(--accent); }
.chips button.on, .chips button.active { color: var(--accent); }
.chips button:disabled { opacity: .4; cursor: default; }

/* Karten, Felder, Schalter */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { color: var(--muted); font-size: .85rem; }
.field input, .field select, .field textarea { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; color: var(--text); width: 100%; }
.field input[type="range"] { padding: 0; accent-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
.check input { width: auto; accent-color: var(--accent); }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { flex: none; width: 38px; height: 22px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); position: relative; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + span { background: var(--green); border-color: var(--green); }
.switch input:checked + span::after { left: 18px; background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); }

/* Status, Hinweise */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.dot.ok, .dot.green { background: var(--green); } .dot.warn, .dot.yellow { background: var(--yellow); } .dot.bad, .dot.red { background: var(--red); }
.rec { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: rec-pulse 2s infinite; }
@keyframes rec-pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); } 70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; max-width: 90vw; white-space: pre-line;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .7); }

/* Allsky-Livebild (skycam.js) */
.sc-stream { position: relative; max-width: 1080px; margin: 0 auto 16px; border-radius: var(--radius); overflow: hidden; background: #000;
  border: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .85); }
.sc-stream.grabbing { cursor: grabbing; }
.sc-inner { position: relative; transform-origin: 0 0; }
.sc-inner img { width: 100%; display: block; min-height: 240px; }
.sc-inner canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sc-hud { position: absolute; top: 10px; left: 10px; background: rgba(0, 0, 0, .6); border: 1px solid rgba(157, 180, 255, .25); color: #e6ebf4;
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; pointer-events: none; }
.sc-hud .rec { margin-right: 5px; vertical-align: middle; }
.sc-zoom { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; align-items: center; }
.sc-zoom button, .sc-zoom span { background: rgba(0, 0, 0, .55); color: #fff; border: 1px solid rgba(255, 255, 255, .2); border-radius: 8px; padding: 4px 10px; font-size: .85rem; }

@media (prefers-reduced-motion: reduce) { .rec { animation: none; } * { scroll-behavior: auto !important; } }
