/* Videochat in der App (index.html #ansicht-video, .nur-videochat) — Reel-Layout */

html,
body.video-seite-live {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--video-buehne-schwarz, #000);
  color: #eef0f4;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.video-seite-huelle {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  min-height: 0;
  padding: 0;
}

.video-seite-anmeldung {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.video-seite-anmeldung[hidden] {
  display: none !important;
}

.video-seite-anmeldung-inner {
  max-width: 360px;
  padding: 24px;
  border-radius: 16px;
  background: rgba(20, 24, 36, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.video-seite-anmeldung-inner p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #cbd5e1;
}

.video-seite-anmeldung-inner a {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 10px;
  background: #6366f1;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

body.video-seite-live #ansicht-video {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  width: 100%;
  background: #000;
  overflow: hidden;
}

body.video-seite-live #ansicht-video[hidden] {
  display: flex !important;
}

body.video-seite-live .video-gitter {
  flex: 1;
  min-height: 0;
  width: 100%;
  z-index: 1;
  gap: 0;
}

body.video-seite-live #video-gitter.video-gitter--n2 .video-gitter-kachel--partner {
  border-bottom: none;
}

/* Verbindungsablauf + Kachel-Diagnose in Live-Video (App) aus */
#ansicht-video .video-verbindungsablauf,
#ansicht-video .video-fehlerlog-panel,
body.video-seite-live .video-verbindungsablauf,
body.video-seite-live .video-fehlerlog-panel {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#ansicht-video .video-gitter-kachel-diagnose,
#ansicht-video .video-gitter-kachel-diagnose-anzeige,
body.video-seite-live .video-gitter-kachel-diagnose,
body.video-seite-live .video-gitter-kachel-diagnose-anzeige {
  display: none !important;
}

/* Reel-Layout auch in index.html #ansicht-video */
#ansicht-video .video-gitter {
  flex: 1;
  min-height: 0;
  width: 100%;
  z-index: 1;
  gap: 0;
}

#ansicht-video #video-gitter.video-gitter--n2 .video-gitter-kachel--partner {
  border-bottom: none;
}

#ansicht-video .video-modus-badge,
#ansicht-video .video-teilnehmer-zaehler {
  display: none !important;
}

.video-reel-kopf-platzhalter {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  pointer-events: none;
}

/* Oben rechts: Einladen (Glas-Pille, immer sichtbar im Video-Tab) */
.video-reel-kopf-rechts {
  justify-self: end;
  position: relative;
  z-index: 96;
  width: auto;
  min-width: 0;
  height: auto;
  flex-shrink: 0;
  pointer-events: auto;
}

.video-einladung-glas-knopf {
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: 46px;
  height: 46px;
  padding: 0 14px 0 11px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(255, 255, 255, 0.1) 45%,
    rgba(120, 90, 255, 0.22) 100%
  );
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow:
    0 4px 22px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.video-einladung-glas-knopf::after {
  display: none !important;
  content: none !important;
  background: none !important;
}

.video-einladung-glas-knopf__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.video-einladung-glas-knopf__icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.video-einladung-glas-knopf__text {
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.video-einladung-glas-knopf:hover,
.video-einladung-glas-knopf:focus-visible {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow:
    0 6px 28px rgba(99, 102, 241, 0.35),
    0 4px 18px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.video-einladung-glas-knopf:active {
  transform: scale(0.96);
}

.video-einladung-glas-knopf--bereit {
  border-color: rgba(167, 243, 208, 0.55);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.32) 0%,
    rgba(52, 211, 153, 0.18) 55%,
    rgba(99, 102, 241, 0.25) 100%
  );
}

.video-einladung-glas-knopf[hidden] {
  display: none !important;
}

/* —— Reel-Steuerung: oben Kopf, Mitte zwischen den Kacheln —— */
.video-reel-steuerung {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.video-reel-zeile--kopf {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  overflow: visible;
  pointer-events: none;
}

.video-reel-knopf {
  pointer-events: auto;
  flex-shrink: 0;
}

.video-reel-raum-name {
  margin: 0;
  justify-self: center;
  max-width: 100%;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--glas-chrome-kreis, rgba(255, 255, 255, 0.14));
  backdrop-filter: var(--glas-chrome-unschaerfe, blur(12px));
  -webkit-backdrop-filter: var(--glas-chrome-unschaerfe, blur(12px));
  box-shadow: var(--glas-chrome-schatten, 0 2px 14px rgba(0, 0, 0, 0.16));
  pointer-events: none;
}

/* Exakt zwischen oberer und unterer Kachel (50 % / Duo-Gitter) */
.video-reel-zeile--zwischen-kacheln {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(8, 10, 16, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
  z-index: 41;
}

.video-reel-zeile--zwischen-kacheln > * {
  pointer-events: auto;
}

body.video-seite-live .video-modus-badge,
body.video-seite-live .video-teilnehmer-zaehler {
  display: none !important;
}

.video-modus-badge[hidden],
.video-teilnehmer-zaehler[hidden] {
  display: none !important;
}

/* Oben links: nur Zurück zur App (Standard-Pfeil) */
.video-reel-knopf--app::after {
  /* glas-zurueck-knopf */
}

/* Mitte: Raum-Pfeile (nicht Zurück) */
.video-reel-knopf--raum-links::after {
  width: 22px;
  height: 22px;
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M14 6l-6 6 6 6' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.video-reel-knopf--raum-rechts::after {
  width: 22px;
  height: 22px;
  background-size: 22px 22px;
  transform: scaleX(-1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M14 6l-6 6 6 6' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.video-reel-knopf--link::after {
  width: 22px;
  height: 22px;
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath stroke='%23ffffff' stroke-width='2' stroke-linecap='round' d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath stroke='%23ffffff' stroke-width='2' stroke-linecap='round' d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E");
}

/* Einladung oben rechts: Breite der Glas-Pille, nicht auf 46px kappen */
#ansicht-video .video-reel-kopf-rechts {
  justify-self: end;
  grid-column: 3;
  width: auto;
  min-width: 0;
  max-width: min(52vw, 168px);
  height: auto;
  overflow: visible;
  z-index: 96;
  pointer-events: auto;
}

/* Vollbild/PiP: nur Raum-links · Kamera · Raum-rechts unten (nicht Bildmitte) */
#ansicht-video.video-eigen-mini .video-reel-steuerung .video-reel-zeile--zwischen-kacheln {
  top: auto;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

/* Profil oben rechts */
.video-reel-zeile--kopf .video-reel-knopf--profil {
  justify-self: end;
  pointer-events: auto;
}

.video-reel-knopf--profil::after {
  display: none;
  content: none;
}

.video-reel-profil-foto {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.video-reel-knopf--profil:not(:has(.video-reel-profil-foto:not([hidden]))) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='8' r='4' stroke='%23fff' stroke-width='2'/%3E%3Cpath stroke='%23fff' stroke-width='2' stroke-linecap='round' d='M4 20c0-4 3.6-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}

/* Profil-Overlays */
.profil-voll-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.profil-voll-overlay[hidden] {
  display: none !important;
}

.profil-dialog {
  width: min(100%, 360px);
  padding: 20px;
  border-radius: 16px;
  background: rgba(24, 28, 40, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.profil-dialog h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

.profil-dialog label {
  display: block;
  margin: 10px 0 4px;
  font-size: 12px;
  color: #94a3b8;
}

.profil-dialog input,
.profil-dialog select,
.profil-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 18, 28, 0.9);
  color: #f1f5f9;
  font: inherit;
}

.profil-dialog-zeile {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: flex-end;
}

.profil-dialog-zeile button {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: transparent;
  color: #e2e8f0;
  font: inherit;
  cursor: pointer;
}

.profil-dialog-primaer {
  background: #6366f1 !important;
  border-color: #6366f1 !important;
  color: #fff !important;
  font-weight: 600;
}

#video-seite-huelle[data-wartet-anmeldung] {
  display: none;
}

@media (max-width: 380px) {
  .video-reel-zeile--zwischen-kacheln {
    gap: 8px;
    padding: 4px 8px;
  }

  button.glas-zurueck-knopf.video-reel-knopf {
    width: 44px;
    height: 44px;
  }

  .video-reel-zeile--kopf {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .video-einladung-glas-knopf {
    height: 44px;
    padding: 0 12px 0 10px;
    font-size: 12px;
  }

  .video-reel-raum-name {
    font-size: 12px;
  }
}
