/* ==========================================================================
   VOLKS-WERK AG - Components Design System
   Interaktive Module: Kurbel-Simulator, Cockpit, Konfigurator, Fax & Abgas
   ========================================================================== */

/* ==========================================================================
   1. KURBEL-SIMULATOR WIDGET
   ========================================================================== */
.crank-simulator-container {
  background: linear-gradient(145deg, #1b2028, #14181f);
  border: 2px solid #30363d;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.crank-sim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

/* Die Autotür mit dem Fensterglas */
.car-door-mockup {
  background: #252c36;
  border: 4px solid #14181e;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.window-frame {
  height: 180px;
  background: linear-gradient(to bottom, #4a6984, #87b5d6);
  border-bottom: 8px solid #181d24;
  position: relative;
  overflow: hidden;
}

.window-glass {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(200,230,255,0.15) 100%);
  border-bottom: 4px solid rgba(255,255,255,0.6);
  transition: transform 0.05s linear;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.window-view-landscape {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: #fff;
  opacity: 0.7;
  font-family: var(--font-mono);
}

/* Türverkleidung mit Kurbelbereich */
.door-panel {
  padding: 2rem;
  background: radial-gradient(circle at 50% 50%, #2f3744 0%, #1f252e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.door-wood-trim {
  width: 90%;
  height: 14px;
  background: linear-gradient(90deg, #5c381e, #8a532d, #5c381e);
  border-radius: 4px;
  border: 1px solid #331e0f;
  margin-bottom: 1.5rem;
}

.crank-interactive-area {
  width: 220px;
  height: 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.crank-interactive-area:active {
  cursor: grabbing;
}

.crank-arm-visual {
  width: 100%;
  height: 100%;
  transition: transform 0.04s linear;
  transform-origin: 50% 50%;
  pointer-events: none;
}

/* Kurbel Dashboard / Metriken */
.crank-metrics-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.metric-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.metric-box {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.metric-value {
  font-size: 1.5rem;
  font-family: var(--font-mono);
  font-weight: 900;
  color: var(--color-primary);
}

/* Fortschrittsbalken Trizeps */
.trizeps-progress-wrapper {
  margin-top: 0.5rem;
}

.progress-bar-bg {
  width: 100%;
  height: 12px;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #e67e22, #f39c12);
  width: 0%;
  transition: width 0.1s ease;
}

.crank-btn-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ==========================================================================
   2. COCKPIT INTERACTIVE EXPLORER
   ========================================================================== */
.cockpit-explorer-wrapper {
  position: relative;
  background-color: #12161c;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cockpit-stage {
  position: relative;
  width: 100%;
  background: #0b0e12;
}

.cockpit-stage svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Hotspots (Pulsierende Pins) */
.cockpit-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(230, 126, 34, 0.8);
  transition: transform 0.2s ease, background-color 0.2s ease;
  z-index: 10;
}

.cockpit-hotspot::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  animation: pulsePin 2s infinite;
  pointer-events: none;
}

@keyframes pulsePin {
  0% { transform: scale(0.9); opacity: 0.8; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(0.9); opacity: 0; }
}

.cockpit-hotspot:hover, .cockpit-hotspot.active {
  background-color: #fff;
  color: var(--color-primary);
  transform: translate(-50%, -50%) scale(1.2);
}

/* Hotspot Koordinaten */
.hotspot-fax { top: 56%; left: 81%; }
.hotspot-crank { top: 70%; left: 14%; }
.hotspot-abakus { top: 62%; left: 60%; }
.hotspot-buttons { top: 78%; left: 59%; }
.hotspot-falk { top: 22%; left: 50%; }
.hotspot-currywurst { top: 58%; left: 38%; }

/* Cockpit Detail Panel */
.cockpit-detail-panel {
  padding: 2rem;
  background-color: #19202a;
  border-top: 1px solid var(--color-border);
}

.detail-card-inner {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.detail-icon-large {
  font-size: 3rem;
  line-height: 1;
  background: #10141a;
  border: 1px solid #30363d;
  padding: 0.75rem;
  border-radius: var(--radius-md);
}

.detail-text-content h3 {
  margin-bottom: 0.25rem;
}

.detail-din-tag {
  display: inline-block;
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   3. ABAKUS BORDCOMPUTER
   ========================================================================== */
.abacus-interactive-container {
  background-color: #5c381e;
  border: 6px solid #381f0d;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 600px;
  margin: 2rem auto 0 auto;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7), 0 10px 25px rgba(0,0,0,0.5);
}

.abacus-row {
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.abacus-wire {
  position: absolute;
  width: 100%;
  height: 4px;
  background: linear-gradient(to bottom, #d5dbdb, #7f8c8d);
  z-index: 1;
}

.abacus-beads-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  justify-content: space-between;
}

.abacus-bead {
  width: 34px;
  height: 38px;
  background: radial-gradient(circle at 35% 35%, #e0a96d, #8a532d);
  border: 2px solid #4a2810;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  box-shadow: 0 4px 6px rgba(0,0,0,0.4);
}

.abacus-bead.shifted {
  transform: translateX(240px);
}

.abacus-result-bar {
  background: #1a2028;
  border: 1px solid #485465;
  border-radius: 4px;
  padding: 0.75rem;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--color-primary);
  font-size: 1.1rem;
  font-weight: bold;
  margin-top: 1rem;
}

/* ==========================================================================
   4. PRÜFSTANDS-MANIPULATOR (Dieselgate Satire)
   ========================================================================== */
.diesel-manipulator-card {
  background: linear-gradient(135deg, #1f2632, #141a22);
  border: 2px solid #485465;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-top: 2rem;
}

.manipulator-toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0;
}

/* Großer Industrie-Hebelschalter */
.lever-switch {
  position: relative;
  display: inline-block;
  width: 90px;
  height: 48px;
}

.lever-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.lever-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #c0392b;
  transition: .3s;
  border-radius: 24px;
  border: 2px solid #fff;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}

.lever-slider:before {
  position: absolute;
  content: "";
  height: 38px;
  width: 38px;
  left: 4px;
  bottom: 3px;
  background-color: #f0f6fc;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

input:checked + .lever-slider {
  background-color: #27ae60;
}

input:checked + .lever-slider:before {
  transform: translateX(42px);
}

.emission-display-board {
  background: #0d1117;
  border: 2px solid #30363d;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.emission-val {
  font-size: 2.4rem;
  font-family: var(--font-mono);
  font-weight: 900;
  color: #ff5555;
  margin: 0.5rem 0;
}

.emission-status-msg {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

/* ==========================================================================
   5. DER VOLKS-KONFIGURATOR
   ========================================================================== */
.configurator-wrapper {
  background-color: var(--color-bg-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.configurator-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
}

.cfg-car-stage {
  position: sticky;
  top: 90px;
  background: #12171f;
  border: 1px solid #30363d;
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.cfg-car-stage svg {
  width: 100%;
  height: auto;
}

.cfg-color-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.cfg-color-pill-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #1a2028;
  border: 1px solid #30363d;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cfg-color-pill-label:hover {
  border-color: var(--color-primary);
}

.cfg-color-pill-label input[type="radio"]:checked + .color-swatch {
  transform: scale(1.3);
  box-shadow: 0 0 8px var(--color-primary);
}

.color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #fff;
  display: inline-block;
  transition: transform 0.2s ease;
}

/* Optionen-Gruppen */
.cfg-section-group {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.cfg-group-title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-primary);
}

.cfg-option-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cfg-radio-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #171c24;
  border: 1px solid #30363d;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cfg-radio-card:hover {
  border-color: #485465;
  background: #1c222c;
}

.cfg-radio-card:has(input:checked) {
  border-color: var(--color-primary);
  background: rgba(230, 126, 34, 0.08);
}

.cfg-opt-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cfg-opt-price {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--color-primary);
}

/* Preis- und Auftragszusammenfassung */
.cfg-summary-box {
  background: #0d1117;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 2rem;
}

.cfg-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.cfg-total-dm {
  font-size: 2.2rem;
  font-family: var(--font-mono);
  font-weight: 900;
  color: var(--color-primary);
}

.cfg-currencies-sub {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  margin-bottom: 1rem;
}

.cfg-summary-list {
  list-style: none;
  font-size: 0.85rem;
  color: #c9d1d9;
  margin-bottom: 1.5rem;
}

.cfg-summary-list li {
  margin-bottom: 0.35rem;
  border-bottom: 1px dashed #21262d;
  padding-bottom: 0.25rem;
}

/* ==========================================================================
   6. VERGLEICHSMATRIX (ID.NULL vs. Digital-Kiste)
   ========================================================================== */
.comparison-table-wrapper {
  overflow-x: auto;
  margin-top: 2rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background-color: var(--color-bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.comparison-table th, .comparison-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.comparison-table th {
  background-color: #161b22;
  font-family: var(--font-heading);
  font-size: 1.1rem;
}

.col-id-null {
  background-color: rgba(230, 126, 34, 0.05);
  font-weight: 600;
}

.comparison-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   7. TELEFAX MODAL & SENDEBERICHT
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #1c232e;
  border: 2px solid var(--color-border-glow);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8);
  position: relative;
  padding: 2rem;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  color: var(--color-text-retro);
}

.form-control {
  width: 100%;
  background-color: #0e1218;
  border: 1px solid #30363d;
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary-glow);
}

/* Fax Papier Auswurf */
.fax-paper-slot {
  background: #0a0d12;
  border: 2px solid #30363d;
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1.5rem;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}

.fax-paper-output {
  display: none;
  background-color: #fffef5;
  color: #111;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 1.5rem;
  border: 1px solid #ccc;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  position: relative;
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.5s ease;
}

.fax-paper-output.printed {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.fax-rubber-stamp {
  position: absolute;
  top: 25px;
  right: 25px;
  width: 150px;
  height: 75px;
  opacity: 0;
  transform: scale(2) rotate(-15deg);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fax-rubber-stamp.stamped {
  opacity: 0.9;
  transform: scale(1) rotate(-8deg);
}

/* Responsive */
@media (max-width: 992px) {
  .crank-sim-grid, .configurator-grid {
    grid-template-columns: 1fr;
  }
  .cfg-car-stage {
    position: static;
  }
}
