/* ==========================================================================
 * APT Booking – Progress + Customer Feedback UI
 * Datei: public/css/apt-progress.css
 * ========================================================================== */

/* =========================================================
   APT Progress (Booking Flow)
   ========================================================= */

#apt-booking-widget{
  position: relative;
  overflow: visible;
}

/* Container – JS übernimmt das Sticky-Verhalten */
.apt-progress{
  margin: 8px 0 18px;
  position: relative;
  z-index: 10;
  background-color: #ffffff;
  padding: 18px 0 14px;
  box-sizing: border-box;
  width: 100%;
}

/* damit im Fixed-Status nichts vom Formular durchscheint */
.apt-progress-inner,
.apt-progress.apt-progress--fixed{
  background-color: #ffffff;
}

/* Platzhalter, wenn per JS auf fixed geschaltet wird */
.apt-progress-placeholder{
  width: 100%;
  display: block;
}

/* Fixed-Status (Hauptmodus via JS) */
.apt-progress.apt-progress--fixed{
  position: fixed;
  left: 0;
  right: 0;
  margin: 0;
  z-index: 1000;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* Kleine Trennlinie darunter */
.apt-progress::after{
  content: "";
  display: block;
  height: 1px;
  margin-top: 6px;
  background: #eef0f4;
}

/* ZENTRIERTER INHALT: leicht breiter als das Formular */
.apt-progress-inner{
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* Grundbalken */
.apt-progress-bar{
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #d5d8dd;
  overflow: visible;
  margin-top: 4px;
}

/* Gefüllter Anteil */
.apt-progress-fill{
  position: absolute;
  inset: 0 auto 0 0;
  width: 5%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2bb3d4, #255a9c);
  transition: width 0.35s ease;
}

/* Auto-Icon */
.apt-progress-car{
  position: absolute;
  bottom: 10px;
  left: 3%;
  width: 99px;
  height: 56px;
  transform: translateX(-50%);
  background: url("../img/apt-progress-car.png") center bottom no-repeat;
  background-size: contain;
  z-index: 1;
  pointer-events: none;
}

/* Zielflagge */
.apt-progress-flag{
  position: absolute;
  bottom: 10px;
  right: 0;
  width: 32px;
  height: 40px;
  transform: translateX(50%);
  background: url("../img/apt-progress-flag.png") center bottom no-repeat;
  background-size: contain;
  z-index: 2;
  pointer-events: none;
}

/* Check-Icon */
.apt-progress-check{
  position: absolute;
  bottom: 10px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: url("../img/apt-progress-check.png") center center no-repeat;
  background-size: contain;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 3;
  pointer-events: none;
}

/* sichtbarer Haken */
.apt-progress-check.is-visible{
  opacity: 1;
  transform: translateX(0);
}

/* Step-Labels */
.apt-progress-steps{
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin: 6px 4px 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.3;
  color: #c0c3d1;
}

.apt-progress-steps li{
  flex: 1 1 0;
  text-align: center;
  white-space: nowrap;
}

/* aktueller oder abgeschlossener Schritt */
.apt-progress-steps li.is-active,
.apt-progress-steps li.is-done,
.apt-progress-steps li.is-complete{
  color: #005f68;
  font-weight: 600;
}

/* abgeschlossene Schritte */
.apt-progress-steps li.is-done,
.apt-progress-steps li.is-complete{
  color: #00434a;
}

/* --- Fertig-Status ------------------------------------------------------ */

.apt-progress.apt-progress--done .apt-progress-fill{
  width: 100% !important;
}

/* Im letzten Step: Icons absolut anordnen
   Reihenfolge: Car – Flag – Check */
.apt-progress.apt-progress--done .apt-progress-car,
.apt-progress.apt-progress--done .apt-progress-flag,
.apt-progress.apt-progress--done .apt-progress-check{
  transform: none;
}

/* Flagge genau am Ende des Balkens */
.apt-progress.apt-progress--done .apt-progress-flag{
  right: 0;
  bottom: 10px;
}

/* Auto direkt links von der Flagge */
.apt-progress.apt-progress--done .apt-progress-car{
  left: auto !important;
  right: 40px;
  bottom: 10px;
}

/* Check leicht außerhalb & oberhalb der Flagge */
.apt-progress.apt-progress--done .apt-progress-check{
  right: -8px;
  bottom: 30px;
  opacity: 1;
}

/* Text im letzten Step hervorheben */
.apt-progress.apt-progress--done .apt-progress-steps li{
  color: #00434a;
  font-weight: 600;
}

/* ------------------------------------------------------------------------ */

/* Fortschrittsbalken erst ab Schritt 2 anzeigen
   Hinweis: blendet auch Car/Flag/Check aus, wenn sie im Balken liegen. */
#apt-booking-widget[data-apt-step="1"] .apt-progress-bar{
  display: none;
}

/* Mobile: Layout anpassen */
@media (max-width: 768px){
  .apt-progress-inner{
    max-width: 100%;
    padding: 0 16px;
  }

  .apt-progress-steps{
    font-size: 11px;
  }

  .apt-progress-car{
    width: 78px;
    height: 44px;
    bottom: 8px;
  }

  .apt-progress-flag{
    width: 28px;
    height: 34px;
    bottom: 8px;
  }

  .apt-progress-check{
    width: 34px;
    height: 34px;
    bottom: 8px;
  }

  .apt-progress.apt-progress--done .apt-progress-car{
    right: 34px;
  }
}

/* ==========================================================================
 * APT Customer Feedback UI
 * - öffentliche Bewertungsmaske (token-basiert)
 * - Header-Zuordnung (Termin-ID/Datum/Zeit)
 * - Kontrast verbessert
 * - Sterne größer + sauber ausgerichtet
 * - Submit-Button rechts (robust via Flex-Form + Actions-Wrapper)
 * ========================================================================== */

/* kleine Utility-Klasse, falls JS sie nutzt */
.apt-is-hidden{
  display: none !important;
}

.apt-feedback-box{
  max-width: 720px;
  margin: 24px auto;
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 24px 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.08);
  border: 1px solid #eef0f4;
  box-sizing: border-box;
}

/* Kopfbereich (neu aus PHP) */
.apt-feedback-head{
  margin-bottom: 14px;
}

.apt-feedback-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 6px 0 10px;
  font-size: 0.92rem;
  color: #374151;
}

.apt-feedback-intro{
  margin: 0 0 10px 0;
  color: #4b5563;
}

.apt-feedback-question-lead{
  margin: 0 0 6px 0;
  color: #111827;
}

/* Titel & Standardtexte */
.apt-feedback-box h2{
  margin: 0 0 6px 0;
  font-size: 1.42rem;
  color: #111827;
}

.apt-feedback-box p{
  margin: 0 0 12px 0;
  color: #4b5563;
}

/* Sections */
.apt-feedback-section{
  margin: 18px 0 22px;
  padding: 16px 16px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
}

/* optional: wenn JS data-section nutzt */
.apt-feedback-section[aria-hidden="true"]{
  opacity: 0.85;
}

.apt-feedback-label{
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  color: #111827;
}

/* Choice-Radios als Pills */
.apt-feedback-choice{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

#apt-feedback-form .apt-feedback-choice label{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  color: #111827;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

#apt-feedback-form .apt-feedback-choice input[type="radio"]{
  accent-color: #255a9c;
  transform: scale(1.05);
  margin: 0;
}

#apt-feedback-form .apt-feedback-choice label:hover{
  background: #f3f6fb;
  border-color: #d7dce3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Followups */
.apt-feedback-followup{
  display: none;
  margin-top: 10px;
}

/* Inputs */
.apt-feedback-section input[type="text"],
.apt-feedback-section input[type="number"],
.apt-feedback-section select,
.apt-feedback-section textarea{
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0 12px;
  padding: 11px 12px;
  border: 1px solid #dbe0e6;
  border-radius: 10px;
  background: #ffffff;
  outline: none;
  color: #111827;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.apt-feedback-section input::placeholder,
.apt-feedback-section textarea::placeholder{
  color: #9ca3af;
}

.apt-feedback-section input:focus,
.apt-feedback-section select:focus,
.apt-feedback-section textarea:focus{
  border-color: #b8c4d6;
  box-shadow: 0 0 0 3px rgba(37,90,156,0.08);
}

.apt-feedback-section input[type="number"]{
  -moz-appearance: textfield;
}

.apt-feedback-section input[type="number"]::-webkit-outer-spin-button,
.apt-feedback-section input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}

.apt-feedback-section textarea{
  resize: vertical;
}

/* ------------------------------
   Händlerbewertung: Sterne-UI
   kompatibel mit:
   .apt-rating-title (PHP-Helper)
   .apt-rating-label (ältere Varianten)
   optional .apt-rating-value
   ------------------------------ */

.apt-rating-row{
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 6px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.08);
}

.apt-rating-row:last-child{
  border-bottom: 0;
}

.apt-rating-title,
.apt-rating-label{
  font-weight: 500;
  color: #111827;
}

/* optionaler Wert rechts */
.apt-rating-value{
  margin-left: 8px;
  font-weight: 600;
  color: #0f172a;
  font-size: 0.95rem;
  min-width: 1.4em;
  text-align: right;
}

/* Fallback-Selects (falls noch vorhanden) */
.apt-rating-row select{
  width: 120px;
}

/* Star Rating Container */
.apt-star-rating{
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

/* Inputs unsichtbar */
.apt-star-rating input[type="radio"]{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Sterne */
.apt-star-rating label{
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
  color: #d1d5db;
  transition: color 0.15s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.apt-star-rating label::before{
  content: "★";
}

/* Hover */
.apt-star-rating label:hover,
.apt-star-rating label:hover ~ label{
  color: #f4b000;
}

/* Checked */
.apt-star-rating input[type="radio"]:checked ~ label{
  color: #f4b000;
}

/* Mini-Pop */
.apt-star-rating label:hover{
  transform: translateY(-1px);
}

/* optional kompakter Modus */
.apt-star-rating.is-compact label{
  font-size: 22px;
}

/* ------------------------------ */

/* Form-Layout: macht Button-Rechtsausrichtung stabil */
#apt-feedback-form{
  display: flex;
  flex-direction: column;
}

/* Actions-Wrapper (passend zu PHP) */
.apt-feedback-actions{
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

/* Submit-Button */
.apt-feedback-submit{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(90deg, #2bb3d4, #255a9c);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.apt-feedback-submit:disabled{
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.apt-feedback-msg{
  margin: 10px 0 0;
  font-size: 0.95rem;
  min-height: 1.2em;
  align-self: stretch;
}

.apt-feedback-msg.is-ok{ color: #0a7a2f; }
.apt-feedback-msg.is-error{ color: #b00020; }

.apt-feedback-success{
  text-align: center;
}

/* Mobile Feinjustierung */
@media (max-width: 768px){
  .apt-feedback-box{
    margin: 18px 12px;
    padding: 20px 16px 12px;
  }

  .apt-feedback-meta{
    font-size: 0.9rem;
  }

  .apt-feedback-choice{
    gap: 10px;
  }

  /* Ratings untereinander sauber */
  .apt-rating-row{
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .apt-rating-row select{
    width: 100%;
  }

  .apt-star-rating{
    gap: 6px;
  }

  .apt-star-rating label{
    font-size: 26px;
  }

  /* Button mobil vollbreit */
  .apt-feedback-actions{
    justify-content: stretch;
  }

  .apt-feedback-submit{
    width: 100%;
  }
}
