/* MESH Produktdemo — geteilte Darstellung für index.html und hausverwaltung.html.
   Inhalte stammen aus der Applikation (ModulDemo.tsx). Die Bühne übernimmt den
   Blauverlauf des Hero; Szenen werden nur beim Schrittwechsel neu aufgebaut,
   damit nichts flackert. */
.mesh-demo {
  --md-linie: rgba(255, 255, 255, .14);
  --md-flaeche: rgba(255, 255, 255, .06);
  --md-text: rgba(255, 255, 255, .74);
  --md-rot: #fca5a5;
  --md-gruen: #6ee7a8;
  --md-gelb: #fcd34d;
  display: grid; gap: 1rem; margin-top: 2.5rem;
}

/* --- Modulwahl --- */
.mesh-demo-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.mesh-demo-tab {
  font: inherit; font-size: .85rem; font-weight: 600;
  padding: .55rem 1.05rem; border-radius: 999px;
  border: 1.5px solid var(--gray-200); background: var(--white);
  color: var(--gray-600); cursor: pointer;
  transition: border-color .16s, color .16s, background .16s;
}
.mesh-demo-tab:hover { border-color: var(--blue-300); color: var(--blue-600); }
.mesh-demo-tab.aktiv { border-color: var(--blue-900); background: var(--blue-900); color: var(--white); }

/* --- Bühne --- */
.mesh-demo-rahmen {
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 22px 60px rgba(10, 22, 40, .18);
}
.mesh-demo-buehne {
  position: relative;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, var(--blue-900), var(--blue-800) 60%, var(--blue-700));
  min-height: 262px;
}
.mesh-demo-buehne::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 82% -10%, rgba(74, 154, 245, .20), transparent 62%);
}
.mesh-demo-leiste {
  display: flex; align-items: center; gap: .5rem;
  padding: .85rem 1.3rem; border-bottom: 1px solid var(--md-linie);
}
.mesh-demo-leiste i {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, .22); display: block;
}
.mesh-demo-leiste span {
  margin-left: .5rem; font-size: .74rem; font-weight: 600;
  letter-spacing: .4px; color: rgba(255, 255, 255, .55);
}
.mesh-demo-szene {
  position: relative; z-index: 1;
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 1.3rem;
  /* Bewusst nur die Position animiert, nicht die Deckkraft: läuft die
     Animation nicht (reduzierte Bewegung, nicht renderndes Fenster), steht der
     Inhalt trotzdem voll sichtbar da. */
  animation: mesh-demo-rein .4s ease;
}
@keyframes mesh-demo-rein { from { transform: translateY(9px); } }

/* --- Text und Steuerung --- */
.mesh-demo-fuss {
  padding: 1.1rem 1.4rem 1.3rem; display: grid; gap: .8rem;
  background: var(--white); border: 1.5px solid var(--gray-200); border-top: none;
  border-radius: 0 0 18px 18px;
}
.mesh-demo-nr { font-size: .68rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--blue-500); }
.mesh-demo-fuss h3 { font-size: 1.05rem; font-weight: 700; color: var(--gray-800); margin: .15rem 0 .25rem; }
.mesh-demo-fuss p { font-size: .88rem; line-height: 1.6; color: var(--gray-500); margin: 0; min-height: 2.9em; }
.mesh-demo-bar { height: 3px; border-radius: 2px; background: var(--gray-200); overflow: hidden; }
.mesh-demo-bar span { display: block; height: 100%; background: var(--blue-500); }
.mesh-demo-steuer { display: flex; align-items: center; gap: .8rem; }
.mesh-demo-play {
  font: inherit; font-size: .8rem; font-weight: 600; padding: .45rem .9rem;
  border-radius: 8px; border: 1.5px solid var(--gray-200); background: var(--white);
  color: var(--gray-700); cursor: pointer;
}
.mesh-demo-play:hover { border-color: var(--blue-400); color: var(--blue-600); }
.mesh-demo-punkte { display: flex; gap: .35rem; margin-left: auto; }
.mesh-demo-punkte button {
  width: 7px; height: 7px; padding: 0; border: none; border-radius: 50%;
  background: var(--gray-300); cursor: pointer; transition: background .15s, transform .15s;
}
.mesh-demo-punkte button.aktiv { background: var(--blue-500); transform: scale(1.4); }
.mesh-demo-dauer { font-size: .75rem; color: var(--gray-400); }

/* --- Szenen (auf dunklem Blau) --- */
.md-formular { display: grid; gap: .45rem; }
.md-feld {
  display: flex; align-items: baseline; gap: .9rem;
  padding: .6rem .85rem; border-radius: 10px;
  background: var(--md-flaeche); border: 1px solid var(--md-linie);
}
.md-feld .l { font-size: .74rem; color: var(--md-text); min-width: 132px; }
.md-feld .w { font-size: .87rem; font-weight: 600; color: var(--white); }

.md-liste { display: grid; gap: .3rem; }
.md-zeile {
  display: grid; gap: .7rem; align-items: center;
  padding: .58rem .85rem; border-radius: 9px;
  background: var(--md-flaeche); border: 1px solid var(--md-linie);
  border-left: 2px solid transparent;
  font-size: .79rem; color: rgba(255, 255, 255, .88);
}
.md-zeile > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-zeile.kopf {
  background: none; border: none; padding: 0 .85rem .15rem;
  font-size: .66rem; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: rgba(255, 255, 255, .42);
}
.md-zeile.rot { border-left-color: var(--md-rot); }
.md-zeile.gruen { border-left-color: var(--md-gruen); }
.md-zeile.gelb { border-left-color: var(--md-gelb); }
.md-zeile.blau { border-left-color: var(--blue-400); }
.md-zeile.rot > span:last-child { color: var(--md-rot); }
.md-zeile.gruen > span:last-child { color: var(--md-gruen); }

.md-kacheln { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.md-kachel {
  display: grid; gap: .2rem; padding: 1rem 1.05rem; border-radius: 12px;
  background: var(--md-flaeche); border: 1px solid var(--md-linie);
}
.md-kachel .w { font-size: 1.45rem; font-weight: 800; letter-spacing: -.6px; color: var(--white); }
.md-kachel .l { font-size: .73rem; color: var(--md-text); line-height: 1.35; }
.md-kachel.gruen .w { color: var(--md-gruen); }
.md-kachel.gelb .w { color: var(--md-gelb); }
.md-kachel.rot .w { color: var(--md-rot); }

.md-upload {
  display: flex; align-items: center; gap: 1rem; padding: 1.15rem;
  border-radius: 12px; background: var(--md-flaeche); border: 1px dashed rgba(255, 255, 255, .28);
}
.md-upload .sym {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  background: rgba(74, 154, 245, .18); color: var(--blue-300);
  display: grid; place-items: center; font-size: 1.05rem;
}
.md-upload .d { display: grid; gap: .18rem; flex: 1; min-width: 0; }
.md-upload .d b { font-size: .88rem; color: var(--white); }
.md-upload .d > span { font-size: .76rem; color: var(--md-text); }
.md-upload .balken { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .14); overflow: hidden; margin-top: .35rem; }
.md-upload .balken i { display: block; height: 100%; background: var(--blue-400); }

.md-chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; padding: .8rem 0; }
.md-chip {
  display: grid; gap: .08rem; padding: .55rem .9rem; border-radius: 11px;
  border: 1px solid var(--md-linie); background: var(--md-flaeche);
}
.md-chip .l { font-size: .82rem; font-weight: 700; color: rgba(255, 255, 255, .9); }
.md-chip .d { font-size: .72rem; color: var(--md-text); }
.md-chip.aktiv { border-color: var(--blue-400); background: rgba(74, 154, 245, .18); }
.md-chip.aktiv .l { color: var(--white); }

@media (max-width: 720px) {
  .md-kacheln { grid-template-columns: 1fr; }
  .mesh-demo-buehne { min-height: 0; }
  .mesh-demo-szene { padding: 1rem; }
  .md-feld { flex-direction: column; gap: .1rem; }
  .md-feld .l { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mesh-demo-szene { animation: none; }
}
