/* =========================
   Grundlayout – hell, leicht
   ========================= */

/* Äußerer Container – analog zum AMV-Tool */
.profile-quiz {
  font-family: inherit;
  text-align: left;           /* Überschrift links, kannst auch center nehmen */

  width: 100%;
  max-width: 440px;           /* ähnlich wie amv: 420px, aber ein Tick Luft */

  margin: 0 auto 1.5rem;
  padding: 20px 16px;

  border: 1px solid #ddd;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);

  box-sizing: border-box;
}

/* Überschrift oben – angelehnt an AMV */
.profile-quiz h2 {
  font-size: 1.45rem;
  margin: 0 0 10px 0;
  color: #3b22a3;
  text-align: center;
}

/* Einleitungstext */
.profile-quiz > p {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 0.98rem;
  color: #444;
  text-align: center;
}


/* =========================
   Stepper
   ========================= */

.pq-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .75rem 0 1.25rem;
}

.pq-stepper button {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  padding: .25rem .6rem;
  font-size: .85rem;
  cursor: pointer;
  color: #4b5563;
  min-width: 2rem;
  text-align: center;
  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .06s ease;
}

.pq-stepper button:hover {
  background: #e5e7eb;
}

.pq-stepper button.pq-step--active {
  background: #3b82f6;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
}

.pq-stepper button.pq-step--correct {
  border-color: #22c55e;
  background: #dcfce7;
  color: #166534;
}

.pq-stepper button.pq-step--wrong {
  border-color: #ef4444;
  background: #fee2e2;
  color: #b91c1c;
}

/* =========================
   Szenario
   ========================= */

.pq-scenario-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
}

.pq-scenario-desc {
  margin: 0;
  font-size: 0.96rem;
  color: #374151;
  line-height: 1.55;
}

.pq-slot-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}

.pq-slot-placeholder {
  font-size: 0.85rem;
}


/* =========================
   Auswahlbereiche
   ========================= */

.pq-selection {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}



.pq-slot {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: .75rem .85rem .9rem;
}

.pq-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .35rem;
}

.pq-slot-label {
  font-size: .9rem;
  font-weight: 600;
  color: #111827;
}

.pq-slot-body {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.pq-slot-preview {
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #f9fafb;
  min-height: 70px;
  /* hier wichtig: */
  padding: 0;          /* KEIN Innenabstand mehr */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  max-width: 520px;    /* gleiche Breite für beide */
  margin: 0 auto;      /* zentriert */
}

.pq-slot-preview img {
  display: block;
  width: 100%;       /* immer volle Breite */
  height: auto;      /* Höhe ergibt sich aus dem Seitenverhältnis */
  object-fit: contain;
  border-radius: 8px;
  cursor: zoom-in;
  background: #ffffff;
}

/* KEINE eigene max-height mehr für Heatmaps */


.pq-slot-placeholder {
  font-size: .8rem;
  color: #9ca3af;
}

/* Erfolgreich gelöstes Szenario */
.pq-slot--success {
  border-color: #22c55e;
  background: #f0fdf4;
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.35),
    0 10px 22px rgba(22, 163, 74, 0.35);
}

.pq-slot--success {
  animation: pqGlow 0.7s ease-out;
}

@keyframes pqGlow {
  0% { box-shadow: 0 0 0 rgba(34, 197, 94,0); }
  60% { box-shadow: 0 0 18px rgba(34,197,94,0.6); }
  100% { box-shadow: 0 0 8px rgba(34,197,94,0.35); }
}



/* =========================
   Buttons & Links
   ========================= */

.pq-btn {
  border-radius: 999px;
  border: none;
  cursor: pointer;
  padding: .45rem 1rem;
  font-size: .95rem;
  font-weight: 600;
  transition: transform .06s ease, box-shadow .06s ease, background .12s ease, border-color .12s ease;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.pq-btn--primary {
  background: #22c55e;
  color: #064e3b;
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.25);
}

.pq-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.3);
}

.pq-btn--secondary {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.pq-btn--secondary:hover {
  background: #dbeafe;
}

.pq-btn--ghost {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #d1d5db;
}

.pq-btn--ghost:hover {
  background: #f3f4f6;
}

.pq-btn:disabled,
.pq-btn[disabled] {
  opacity: .5;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.pq-link {
  border: none;
  background: transparent;
  padding: 0;
  font-size: .8rem;
  cursor: pointer;
  text-align: left;
}

.pq-link-remove {
  color: #b91c1c;
}

.pq-link-remove:hover {
  text-decoration: underline;
}

/* =========================
   Navigation
   ========================= */

.pq-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}

/* =========================
   Ergebnis
   ========================= */

.pq-result {
  margin-top: .5rem;
  font-size: .9rem;
  color: #374151;
}

.pq-result strong {
  color: #b45309;
}

/* =========================
   Picker-Overlay (Bildauswahl)
   ========================= */

.pq-picker {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.pq-picker.is-visible {
  display: flex;
}

.pq-picker__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
}

.pq-picker__dialog {
  position: relative;
  background: #f9fafb;
  border-radius: 16px;
  padding: .75rem .9rem 1rem;
  max-width: 900px;
  width: 95vw;
  max-height: 90vh;
  box-shadow: 0 20px 40px rgba(0,0,0,0.45);
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.pq-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .25rem;
}

.pq-picker__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.pq-picker__close {
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 1.2rem;
  cursor: pointer;
}

.pq-picker__grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.25rem;
  overflow: auto;

  align-items: center;   /* zentriert die 70%-breiten Items */
}

.pq-picker__item {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: .4rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  width: 70%;
  transition: border-color .12s ease, box-shadow .12s ease, transform .06s ease;
}

.pq-picker__item:hover {
  border-color: #3b82f6;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.pq-picker__item img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
  cursor: zoom-in;
}

.pq-picker__item-label {
  font-size: .75rem;
  color: #6b7280;
}

.pq-picker__imgwrap {
  position: relative;
}

.pq-picker__overlay {
  position: absolute;
  inset: 0.15rem 0.15rem auto auto;
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
  align-items: flex-start;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
}

/* Overlay auf Desktop bei Hover einblenden */
.pq-picker__item:hover .pq-picker__overlay {
  opacity: 1;
  pointer-events: auto;
}

/* auf Touch-Geräten wollen wir die Buttons immer sichtbar haben */
@media (hover: none) {
  .pq-picker__overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

.pq-picker__icon {
  border: none;
  border-radius: 999px;
  padding: 0.15rem 0.4rem;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pq-picker__icon--zoom {
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

.pq-picker__icon--select {
  background: #22c55e;
  color: #052e16;
}


/* =========================
   Lightbox
   ========================= */

.pq-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.pq-lightbox.is-visible {
  display: flex;
}

.pq-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
}

.pq-lightbox__content {
  position: relative;
  background: #0b1120;
  border-radius: 12px;
  padding: 0.75rem 0.75rem 0.9rem;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1;
}

.pq-lightbox__content img {
  max-width: 88vw;
  max-height: 72vh;
  border-radius: 8px;
  display: block;
}

.pq-lightbox__caption {
  display: none; /* keine Beschriftung anzeigen */
}

.pq-lightbox__close {
  position: absolute;
  top: 0.25rem;
  right: 0.35rem;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ==================================
   Mobile-Optimierung
   ================================== */
@media (max-width: 640px) {

  /* Karte kompakter, weniger „grau“ ringsherum */
  .profile-quiz {
    padding: 0.9rem 0.75rem 1.1rem;
    margin: 0 auto 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  }

  /* Texte etwas größer und besser lesbar */
  .profile-quiz h2 {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
  }

  .profile-quiz p,
  .pq-scenario-desc {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .pq-scenario-title {
    font-size: 1.05rem;
  }

  /* Stepper kompakter, aber lesbar */
  .pq-stepper {
    gap: 0.35rem;
    margin-bottom: 0.9rem;
  }

  .pq-stepper button {
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
  }

  /* Slots enger zusammen, weniger Luft dazwischen */
  .pq-selection {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.9rem;
  }

  .pq-slot {
    padding: 0.6rem 0.6rem 0.75rem;
  }

  /* Weniger „graue Wiese“ in der Vorschau */
  .pq-slot-preview {
    min-height: 40px;           /* kleiner */
    padding: 0;                 /* kein extra Rand */
    align-items: flex-start;    /* Bild oben, nicht mittig */
    justify-content: flex-start;
    max-width: 100%;
    margin: 0;
  }

  .pq-slot-preview img {
    width: 100%;
    height: auto;
    /* keine max-height, damit die Breite entscheidet */
  }

  /* Erfolgsslot darf trotzdem hübsch bleiben */
  .pq-slot--success .pq-slot-preview img {
    width: 100%;
    height: auto;
  }

  /* Buttons etwas kleiner, damit sie nicht „dominieren“ */
  .pq-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
  }

  .pq-link-remove {
    font-size: 0.75rem;
  }

  /* Picker auf Mobil eher wie Vollbild-Galerie */
  .pq-picker__dialog {
    max-width: 100vw;
    width: 100vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    padding: 0.6rem 0.6rem 0.9rem;
  }

  .pq-picker__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .pq-picker__item {
    padding: 0.3rem;
  }
}

@media (max-width: 600px) {

  .profile-quiz {
    padding: 16px 12px;
    max-width: 100%;
    border-radius: 10px;
  }

  .profile-quiz h2 {
    font-size: 1.5rem;
  }

  .profile-quiz > p {
    font-size: 1.02rem;
  }

  .pq-scenario-title {
    font-size: 1.08rem;
  }

  .pq-scenario-desc {
    font-size: 1.02rem;
  }

  .pq-slot-label {
    font-size: 0.95rem;
  }

  .pq-btn {
    font-size: 0.97rem;
    padding: 0.45rem 1rem;
  }

  .pq-stepper button {
    font-size: 0.85rem;
  }
}
