/* ======================================================
   Globales Layout
   ====================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --gap: 12px;
  --radius: 8px;
  --border: #d7d7d7;
  --bg: #ffffff;
  --bg-muted: #f6f6f6;
  --text: #111;
  --accent: #0a66ff;
}

html,
body {
  height: 100%;
  padding: 0px !important;
}
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: #fafafa;
  padding: 20px;
  line-height: 1.4;
  overflow: hidden;
}

h1 {
  margin-bottom: 28px;
  font-size: 1.75rem;
}
h2 {
  margin: 18px 0;
  font-size: 1.2rem;
}

label {
  display: inline-block;
  margin: 0 10px 6px 0;
  font-weight: 600;
}
select {
  margin: 0 20px 10px 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  min-width: 200px;
}

/* ======================================================
   Stage Tabs
   ====================================================== */
#stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px 0;
}

.stage-tab {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  background: var(--bg-muted);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.stage-tab:hover {
  background: #eee;
}
.stage-tab.active {
  background: var(--bg);
  border-bottom-color: var(--bg);
  font-weight: 700;
}

#stage-content {
  border: 1px solid var(--border);
  border-radius: 0 8px 8px 8px;
  padding: 14px;
  background: var(--bg);
}

#stage-content p {
  margin-bottom: 8px;
}

/* ======================================================
   SVG – Tachometer
   ====================================================== */
/* Das SVG bitte inline einfügen (kein <img>) */
svg {
  display: block;
  max-width: 100%; /* kannst du anpassen */
  width: 100%;
  height: auto;
  margin: 14px auto;
}
.ergebnis-anzeige {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%; /* gleiche Breite wie dein SVG */
  max-width: 1200px;
  margin: 0 auto; /* zentriert den gesamten Block */
  position: relative;
}
/* Ergebnisbereich */
#ergebnis {
  background: #111;
  color: #eee;
  border: 1px solid #444;
  border-radius: 6px;
  text-align: center;
  padding: 1em;
  width: 100%; /* automatisch gleiche Breite wie das SVG */
  margin-top: -350px !important; /* hebt es leicht in die „Aussparung“ hinein */
  position: relative;
  z-index: 2; /* über dem SVG sichtbar */
}

/* Zeiger-Basis: weiche Bewegung */
.zeiger,
.zeiger2 {
  /* sehr wichtig: damit transform-origin im SVG-Koordinatensystem interpretiert wird */
  transform-box: fill-box;
  transition: transform 2.2s cubic-bezier(0.22, 0.8, 0.18, 1); /* smooth */
  will-change: transform;
}

/* >>> KORREKTE DREHPUNKTE (aus deiner SVG ausgelesen) <<< */

/* Linker Zeiger (PS) – Knopf unter .st51: cx=150.1, cy=96.5 */
.zeiger {
  transform-origin: 150.1px 96.5px;
}

/* Rechter Zeiger (Nm) – Knopf unter .st31: cx=249.1, cy=96.5 */
.zeiger2 {
  transform-origin: 249.1px 96.5px;
}

/* Optional: falls der „Knopf“ sicher über den Zeigern liegen soll
   (die Z-Order im SVG regelt normalerweise die Zeichenreihenfolge) */
.st51,
.st31 {
  pointer-events: none;
}

/* Accessibility: weniger Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  .zeiger,
  .zeiger2 {
    transition: none;
  }
}

/* Kleine Screens */
@media (max-width: 520px) {
  select {
    min-width: 160px;
  }
}

/* --- Grundlegende Styles für SVG-Zeigeranimation --- */
#Zeiger_Links,
#Zeiger_Rechts {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 1s ease-in-out;
}

#Zeiger_Rechts {
  transform: rotate(0deg);
  transform-origin: 99px 74.7px;
}
#Zeiger_Links {
  transform: rotate(0deg);
  transform-origin: 75px 74.4px;
}

/* Optional: sanftere Übergänge bei Werteänderungen */
.animated {
  transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

#highlight-links {
  stroke-width: 7px;
  opacity: 1;
}
#highlight-rechts {
  stroke-width: 6px !important;
  opacity: 1;
}

#blinker-links,
#blinker-rechts {
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.1s ease;
}

#blinker-links:hover,
#blinker-rechts:hover {
  filter: drop-shadow(0 0 6px #00ff00);
}

#blinker-links,
#blinker-rechts {
  cursor: pointer;
  pointer-events: all;
}

#blinker-links *,
#blinker-rechts * {
  pointer-events: visiblePainted;
  fill: rgb(89 89 89);
  box-sizing: border-box;
}

#blinker-links:hover *,
#blinker-rechts:hover * {
  fill: #9cff00;
  box-sizing: border-box;
}

select {
  width: 15%;
  padding: 0.4em 0.8em;
  font-size: 1rem;
  background: #111;
  color: #eee;
  border: 1px solid #444;
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

/* scrollbar im geöffneten Dropdown */
select option {
  max-height: 2em;
}

/* kleine UI-Verbesserung für das Dropdown selbst */
select:focus {
  outline: 1px solid lime;
}

/* Firefox & Chrome öffnen Dropdowns nach unten,
   wenn darunter genug Platz ist — wir erzwingen extra Platz */

/* Grundlayout */
#auto-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Jeder Navigationsblock (Marke, Modell etc.) */
.nav-block {
  flex: 1 1 200px;
  background: #111;
  border: 1px solid #444;
  border-radius: 6px;
  max-height: 12em; /* Sichtbar ~8 Einträge */
  overflow-y: auto;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* Einzelne Einträge */
.nav-item {
  padding: 0.6em 0.8em;
  color: #eee;
  cursor: pointer;
  border-bottom: 1px solid #222;
  transition: background 0.2s, color 0.2s;
}

/* Hover-Effekt */
.nav-item:hover {
  background: #333;
}

/* Aktive Auswahl */
.nav-item.active {
  background: lime;
  color: #111;
  font-weight: bold;
}

/* Überschrift */
h1 {
  font-family: "Yanone Kaffeesatz", sans-serif;
  font-size: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Stage Tabs */
#stage-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.stage-tab {
  padding: 0.5em 1em;
  background: #222;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  color: #eee;
}

.stage-tab:hover {
  background: #333;
}

.stage-tab.active {
  background: lime;
  color: #111;
  font-weight: bold;
}

/* Stage-Content */
#stage-content {
  margin-top: 1rem;
  line-height: 1.6;
  font-size: 1rem;
}

.dropdown {
  position: relative;
  display: inline-block;
  width: 200px;
  font-family: sans-serif;
}

.dropdown .selected {
  background: #111;
  color: #eee;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 0.4em 0.8em;
  cursor: pointer;
  user-select: none;
  min-width: 260px;
  text-align: center;
  position: relative;
}

.dropdown .options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 12em; /* ≈ 8 Zeilen */
  overflow-y: auto;
  background: #111;
  border: 1px solid #444;
  border-radius: 4px;
  z-index: 100;
}

.dropdown.open .options {
  display: block;
}

.dropdown .option {
  padding: 0.4em 0.8em;
  cursor: pointer;
  color: white;
}

.dropdown .option:hover {
  background: #333;
}

.dropdown .option.active {
  background: limegreen;
  color: #000;
}

#stage-content p {
  color: black;
}

.selected::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #ffffff; /* Farbe des Pfeils */
  pointer-events: none; /* verhindert Klick-Blockade */
}

.dropdown,
.dropdown .selected,
.dropdown .options {
  width: 260px;
  box-sizing: border-box; /* verhindert, dass Padding die Gesamtbreite verändert */
}

/* optional: damit die .option-Elemente genau in die Box passen */
.dropdown .option {
  width: 100%;
  box-sizing: border-box;
}

#blinker-rechts::after {
  content: "Stage +";
  color: white;
}

#blinker-links::after {
  content: "Stage -";
  color: white;
}

#blinker-links,
#blinker-rechts {
  position: relative;
}

#stage-tabs {
  justify-content: center;
}

#auto-nav {
  justify-content: center;
}

.dropdown .option.active {
  background: limegreen;
  color: #000;
}
/* SVG-Stage-Badges klickbar kennzeichnen (falls nötig) */
#Stage_1,
#Stage_2,
#Stage_3,
#Stage_4 {
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}
#Stage_1:hover .cls-19,
#Stage_2:hover .cls-19,
#Stage_3:hover .cls-19,
#Stage_4:hover .cls-19 {
  fill: #72b806;
}

#Stage_1.active .cls-19,
#Stage_2.active .cls-19,
#Stage_3.active .cls-19,
#Stage_4.active .cls-19 {
  fill: #72b806;
}

/* Blinker: Standardzustand */
#blinker-links rect,
#blinker-rechts rect {
  transition: fill 0.2s ease;
}

/* Aktiv bei Klick (Feedback) */
.blinker-active rect {
  fill: #9cff00 !important;
}

/* iOS/Android-Highlight deaktivieren */
#blinker-links,
#blinker-rechts {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.tachometer {
  position: relative;
  background-image: url(../layout/hintergrund_porsche.png);
  background-size: cover;
  width: 100vw;
  min-height: 100vh;
}
.tachometer svg {
  position: absolute;
  top: 30%;
  left: 2%;
  width: 50%;
}
svg {
  filter: drop-shadow(0 3px 6px rgba(0, 10, 10, 0.5)) contrast(1.1)
    saturate(0.8) brightness(1.2) blur(0.3px);
}

.konfigurator {
  height: 100%;
  position: absolute;
  width: 100%;
}

#auto-nav {
  width: 60%;
  margin-right: auto;
}

.konfigurator h1 {
  margin: 30px 0px;
  color: white;
}

@media screen and (max-width: 992px) {
  .tachometer svg {
    width: 90%;
    top: 35%;
    left: 5%;
  }
  #auto-nav {
    width: 100%;
  }
}

@media screen and (max-width: 600px) {
  .tachometer svg {
    width: 100%;
    transform: scale(1.6);
    top: 55%;
    left: 0%;
  }
  #marken-nav,
  #modelle-nav,
  #motoren-nav,
  #stufen-nav {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .selected,
  #motor-nav,
  #motorart-nav {
    min-width: 90% !important;
  }
  .options {
    width: 90% !important;
    left: 50% !important;
    transform: translate(-50%);
  }
  #motor-nav .selected,
  #motorart-nav .selected {
    width: 100%;
  }
}
