@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;900&family=Barlow:wght@400;500;600&display=swap');

/* ============================================================================
 * VoltDetective — ElektroGenius Design-System (Navy/Cyan, Barlow)
 * ==========================================================================*/
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0d1b2e;
  --card-bg: #0f2035;
  --card-bg2: #13273f;
  --cyan: #00c6ff;
  --red: #e63030;
  --orange: #f5a623;
  --ok: #3ddc84;
  --no: #ff5c5c;
  --glow: #ffd34d;
  --text: #f0f4ff;
  --muted: #7a95b0;
  --border: rgba(0,198,255,0.15);
  --radius: 12px;
  --flip: 160ms;
}

html, body {
  min-height: 100%;
  background: var(--navy);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body { display: flex; justify-content: center; }

#app {
  width: 100%;
  max-width: 940px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── HEADER ── */
#header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,27,46,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 14px; height: 54px;
  display: flex; align-items: center; gap: 10px;
}
.logo-circle {
  width: 34px; height: 34px; background: var(--cyan); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 13px;
  color: var(--navy); flex-shrink: 0; letter-spacing: -0.5px;
}
#header-title {
  flex: 1; font-family: 'Barlow Condensed', sans-serif; font-weight: 900;
  font-size: 19px; letter-spacing: 0.04em; text-align: center;
}
.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 34px; height: 34px; border: none; background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer;
  transition: color .2s, background .2s;
}
.icon-btn:hover { color: var(--cyan); background: rgba(0,198,255,0.08); }

/* ── INTRO ── */
#content { flex: 1; padding: 18px 16px 8px; }
.intro { text-align: center; margin: 6px 0 18px; }
.intro-title {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 30px;
  letter-spacing: 0.02em; line-height: 1.05;
}
.intro-sub { color: var(--muted); font-size: 14px; max-width: 620px; margin: 6px auto 0; }

/* ── SVG-Icons ── */
.ic { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--card-bg2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 14px; font-family: 'Barlow', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, background .15s, transform .05s;
}
.btn:hover { border-color: var(--cyan); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--cyan); color: var(--navy); border-color: var(--cyan);
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900; letter-spacing: .02em; }
.btn.primary:hover { background: #2ad0ff; }
.btn.accent { background: rgba(245,166,35,0.14); border-color: rgba(245,166,35,0.45); }
.btn.accent:hover { border-color: var(--orange); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.tiny { padding: 5px 9px; font-size: 12px; font-weight: 500; }
.btn.tiny .ic { width: 13px; height: 13px; }

/* ── Karten-Container ── */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); }

/* ── Kontrollleiste ── */
.ctrlbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.status .ic { color: var(--cyan); }
.status.solved { color: var(--ok); }
.status.solved .ic { color: var(--ok); }
.ctrlbar .btn.primary { margin-left: auto; }

/* ── Layout ── */
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } }

/* ── Raum ── */
.room { padding: 18px; }
.ceiling { display: flex; flex-direction: column; gap: 20px; }
.group-title { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: .07em; }
.lamp-row { display: flex; gap: 18px; }
.lamp-row.wrap { flex-wrap: wrap; }

/* ── Lampe ── */
.lamp { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 92px; }
.bulb {
  position: relative; width: 54px; height: 54px; border-radius: 50%;
  background: #16273d; border: 2px solid #294764; display: grid; place-items: center;
  transition: background 40ms ease, border-color 40ms ease, box-shadow 40ms ease; /* Reaktion < 50 ms */
}
.bulb .glow {
  position: absolute; inset: -6px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, var(--glow), transparent 68%);
  transition: opacity 40ms ease;
}
.bulb .filament { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #33506e; transition: all 40ms ease; }
.lamp.lit .bulb { background: #ffe9a6; border-color: #ffcf5a; box-shadow: 0 0 22px 6px rgba(255,211,77,.5); }
.lamp.lit .glow { opacity: .9; }
.lamp.lit .filament { border-color: #d98a00; background: var(--glow); }
.lamp-label { font-size: 12px; color: var(--muted); text-align: center; }

/* ── Wand: Sicherung + Schalter ── */
.wall { margin-top: 22px; display: flex; gap: 14px; flex-wrap: wrap;
  padding-top: 18px; border-top: 1px dashed var(--border); }
.device { background: var(--card-bg2); border: 1px solid var(--border); border-radius: 11px;
  padding: 13px; min-width: 148px; text-align: center; }
.device-title { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.device-title .ic { color: var(--cyan); width: 15px; height: 15px; }
.fuse-box .device-title .ic { color: var(--orange); }
.device-sub { font-size: 11px; color: var(--muted); margin-top: 8px; }
.plate { display: flex; gap: 10px; justify-content: center; }
.plate.series { padding: 6px; border: 1px dashed var(--border); border-radius: 10px; }

/* ── Wippe / Rocker mit Kipp-Animation ── */
.rocker {
  position: relative; width: 46px; height: 68px; border-radius: 8px;
  background: #0b1420; border: 1px solid var(--border); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; padding-top: 6px; gap: 6px;
}
.rocker .knob {
  width: 34px; height: 25px; border-radius: 5px; background: #3a5474;
  transform: translateY(28px) rotateX(35deg); transform-origin: bottom;
  transition: transform var(--flip) cubic-bezier(.34,1.56,.64,1), background 120ms ease;
}
.rocker.on .knob { transform: translateY(0) rotateX(-18deg); background: var(--cyan); }
.rocker.big { width: 58px; height: 82px; }
.rocker.big .knob { width: 42px; height: 30px; }
.rocker.big.on .knob { background: var(--orange); }
.rk-label { font-size: 10px; color: var(--muted); }

/* ── Diagnose-Panel ── */
.panel { padding: 16px; }
.panel-title { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 16px; }
.panel-title .ic { color: var(--cyan); width: 18px; height: 18px; }
.muted { color: var(--muted); font-size: 13px; }
.diag-list { list-style: none; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.diag-list li { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 8px;
  font-size: 13px; background: var(--card-bg2); border: 1px solid var(--border); }
.diag-list li .ic { width: 15px; height: 15px; flex-shrink: 0; }
.diag-list li.good { border-color: rgba(61,220,132,.4); }
.diag-list li.good .ic { color: var(--ok); }
.diag-list li.bad { border-color: rgba(255,92,92,.4); }
.diag-list li.bad .ic { color: var(--no); }
.diag-list li.empty { color: var(--muted); font-style: italic; }
.hint { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 11px; border-radius: 8px;
  background: rgba(0,198,255,0.07); border: 1px solid rgba(0,198,255,0.22); font-size: 13px; }
.hint .ic { color: var(--cyan); width: 16px; height: 16px; margin-top: 1px; }

/* ── Detail-Overlay ── */
.overlay { position: fixed; inset: 0; background: rgba(5,10,18,.74); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 18px; z-index: 300; }
.overlay.hidden { display: none; }
.modal { width: min(540px, 100%); max-height: 90vh; overflow: auto; padding: 20px; background: var(--card-bg); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900; font-size: 21px; }
.card-head h2 .ic { color: var(--cyan); }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.tool-btn { justify-content: flex-start; text-align: left; }
.tool-btn .ic { color: var(--cyan); }
.readout { background: #0a121e; border: 1px solid var(--border); border-radius: 8px; padding: 14px;
  min-height: 54px; font-size: 14px; font-family: ui-monospace, 'Cascadia Code', monospace; }
.readout b.ok, b.ok { color: var(--ok); }
.readout b.no, b.no { color: var(--no); }
.warn { color: var(--orange); }
.diagnose { margin-top: 18px; }
.diagnose h3 { font-size: 15px; margin-bottom: 10px; }
.diag-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.feedback:empty { display: none; }
.feedback { margin-top: 14px; }
.fb { display: flex; align-items: flex-start; gap: 9px; padding: 12px; border-radius: 8px; font-size: 14px; }
.fb .ic { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; }
.ok-fb { background: rgba(61,220,132,.12); border: 1px solid rgba(61,220,132,.4); }
.ok-fb .ic { color: var(--ok); }
.bad-fb { background: rgba(255,92,92,.12); border: 1px solid rgba(255,92,92,.4); }
.bad-fb .ic { color: var(--no); }

/* ── DISCLAIMER / FOOTER / COOKIE ── */
#disclaimer-bar { display: flex; align-items: flex-start; gap: 8px; padding: 8px 16px;
  background: rgba(245,166,35,0.06); border-top: 1px solid rgba(245,166,35,0.18);
  font-size: 11px; color: rgba(240,244,255,0.55); line-height: 1.45; }
#footer { padding: 16px 14px; text-align: center; font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--border); }
#footer a { color: var(--cyan); text-decoration: none; }
#footer a:hover { text-decoration: underline; }
#cookie-banner { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 940px; background: var(--card-bg); border-top: 1px solid var(--border);
  padding: 14px 16px; z-index: 400; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#cookie-text { flex: 1; font-size: 12px; color: var(--muted); min-width: 180px; }
#cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
#cookie-accept { background: var(--cyan); color: var(--navy); border: none; border-radius: 7px;
  padding: 8px 14px; font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 13px; cursor: pointer; }
#cookie-reject { background: transparent; color: var(--muted); border: 1px solid rgba(122,149,176,0.25);
  border-radius: 7px; padding: 8px 12px; font-size: 13px; cursor: pointer; }
#cookie-reject:hover { color: var(--text); }

/* ── Mobile ── */
@media (max-width: 480px) {
  .intro-title { font-size: 25px; }
  .tools { grid-template-columns: 1fr; }
  .lamp { width: 76px; }
  .bulb { width: 48px; height: 48px; }
  .btn { min-height: 44px; }
  .device { flex: 1; min-width: 130px; }
}
