/* ✅ KI-TEST CSS - NUR SEITENSPEZIFISCHE STYLES */
/* (Generische Button-Styles sind jetzt in pp_haupt.css) */

/* 🎯 SEITENSPEZIFISCH: KI-Test Container & Layout */
#ki-test-container {
  display: block;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  background: #f9f9f9;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
  font-weight: normal;
  font-size: 16px;
  line-height: 1.5;
}

/* 🔵 SPEZIFISCHE START/NEXT BUTTONS (Test-Interface) */
#start-test,
#next-question {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  padding: 16px 24px;
  font-size: 18px;
  font-weight: bold;
  color: white;
  background: #0073e6;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.2);
}

#start-test:hover,
#next-question:hover {
  background: #005bb5;
  transform: scale(1.05);
}

/* 🎯 FRAGEN-INTERFACE (Test-spezifisch) */
#question-container {
  display: block;
  position: relative;
  max-width: 600px;
  margin: 30px auto;
  padding: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
  width: 100%;
  text-align: left;
  margin-bottom: 10px;
}

#question-text {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
}

/* 🎯 ANTWORT-SLIDER SYSTEM (Test-spezifisch) */
#answer-slider {
  width: 100%;
  margin: 20px 0;
}

#answer-labels {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 15px 0 !important;
}

.answer-label {
  flex: 1 !important;
  text-align: center !important;
  padding: 10px 5px !important;
  background: #f8f9fa !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.answer-label:hover {
  background: #e9ecef !important;
  border-color: #adb5bd !important;
}

.answer-label.selected {
  background: #007bff !important;
  color: white !important;
  border-color: #007bff !important;
}

/* 🎯 FORTSCHRITT-SYSTEM (Test-spezifisch) */
#progress-container {
  margin-top: 20px;
}

progress {
  width: 100%;
  height: 12px;
  border-radius: 6px;
}

progress::-webkit-progress-bar {
  background-color: #eee;
  border-radius: 6px;
}

progress::-webkit-progress-value {
  background-color: #0073e6;
  border-radius: 6px;
}

/* 🎯 ERGEBNIS-CONTAINER (Test-spezifisch) - ERWEITERT! */
#result-container {
  display: none;
  position: relative;
  max-width: 800px;
  margin: 40px auto;
  padding: 30px;
  background: white;
  border-radius: 12px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 5;
  line-height: 1.6;
}

#result-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

#result-text {
  padding: 25px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #0073e6;
  margin-bottom: 25px;
}

#result-chart {
  margin: 30px 0;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  min-height: 400px;
}

.result-header h6 {
  font-size: 28px;
  color: #0073e6;
  margin-bottom: 20px;
  text-align: center;
}

.result-summary,
.result-deep-dive,
#save-options,
#upgrade-section {
  text-align: left;
  margin-top: 25px;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e9ecef;
}

/* 🎯 DIAGRAMM-CONTAINER (Test-spezifisch) */
#chart-container {
  max-width: 100%;
  height: auto;
  width: 90vw;
  max-height: 250px;
  display: block;
  margin: auto;
}

/* 🎯 PAYPAL INTEGRATION (Test-spezifisch) */
#paypal-button {
  background-color: #ffc439;
  color: black;
  font-size: 18px;
  padding: 12px 20px;
  cursor: pointer;
  border-radius: 8px;
  margin-top: 20px;
  border: none;
}

/* 🎯 SPRACHAUSWAHL (Test-spezifisch) */
.lang-button {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  font-size: 16px;
  text-align: center;
  background-color: #007bff;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  border: none;
}

.lang-button:hover {
  background-color: #0056b3;
}

/* 🎯 LOADING OVERLAY (Test-spezifisch) */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
}

/* ==============================
   📱 MOBILE-OPTIMIERUNGEN (KI-TEST)
   Ziel: Breite besser ausnutzen, weniger Scrollen
   ============================== */

@media (max-width: 600px) {
  /* Container dichter, aber volle Breite nutzen */
  #ki-test-container {
    padding: 12px;
    max-width: 100% !important;
  }

  /* Fragen-Card kompakter und 100% Breite */
  #question-container {
    max-width: 100%;
    margin: 12px auto;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  }

  /* Überschrift/Frage fluid skalieren */
  #question-text {
    font-size: clamp(16px, 4.5vw, 20px);
    margin-bottom: 12px;
  }

  /* Einleitungstexte im Startbereich kompakter */
  #start-container p {
    font-size: clamp(14px, 4vw, 16px);
    margin: 8px 0 10px 0;
  }

  /* Antwort-Labels in mehrere Spalten statt untereinander */
  #answer-labels {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .answer-label {
    flex: 1 1 calc(50% - 8px) !important; /* 2 Spalten */
    min-width: calc(50% - 8px) !important;
    padding: 10px 6px !important;
    font-size: 13px !important;
    min-height: 36px !important;
  }

  /* Ergebnis kompakter darstellen */
  #result-container {
    max-width: 100%;
    margin: 16px auto;
    padding: 16px;
  }

  #result-chart {
    min-height: 240px;
    padding: 12px;
  }

  /* Buttons angenehmer groß, aber nicht zu hoch */
  #start-test,
  #next-question {
    width: 100%;
    padding: 12px 16px;
    font-size: clamp(15px, 4vw, 17px);
    margin: 12px 0;
  }
}

@media (max-width: 380px) {
  /* Bei sehr schmalen Geräten: 3 Spalten für weniger Scroll */
  .answer-label {
    flex: 1 1 calc(33.333% - 8px) !important;
    min-width: calc(33.333% - 8px) !important;
    font-size: 12px !important;
    padding: 8px 6px !important;
  }

  #result-chart {
    min-height: 200px;
  }
}

/* ===== UX: Ergebnisformular besser klickbar (auch mobil) ===== */
.result-header {
  text-align: center;
}
.result-header h6 {
  font-size: clamp(18px, 5vw, 22px);
  margin: 0 0 10px 0;
}
.email-capture {
  text-align: center;
}
.email-capture h6 {
  font-size: clamp(16px, 4.5vw, 18px);
  margin: 0 0 8px 0;
}
.email-capture p {
  margin: 0 0 12px 0;
}
.email-form .form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.email-form .form-row input[type="text"],
.email-form .form-row input[type="email"] {
  flex: 1 1 0;
  padding: 12px 14px;
  font-size: 16px;
}
.privacy-policy {
  margin: 10px 0 10px 0;
}
.email-capture button[type="submit"] {
  width: 100%;
  padding: 14px 16px;
  margin-top: 10px;
  font-size: 16px;
}
.email-note {
  color: #6b7280;
  font-size: 12px;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .email-form .form-row {
    flex-direction: column;
    gap: 10px;
  }
  .email-capture button[type="submit"] {
    padding: 15px;
    font-size: 17px;
  }
}

/* Kompaktere Abstände zwischen innerem und äußerem Container */
@media (max-width: 600px) {
  #result-container {
    padding: 10px;
    margin: 10px auto;
  }
}

.hourglass {
  width: 60px;
  height: 60px;
  margin: 20px auto;
  position: relative;
  animation: rotate 2s linear infinite;
}

.hourglass:before,
.hourglass:after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 30px 30px 0 0;
  border-color: #0073e6 transparent transparent transparent;
  animation: hourglass-top 1s linear infinite;
}

.hourglass:after {
  top: 30px;
  border-width: 0 0 30px 30px;
  border-color: transparent transparent #0073e6 transparent;
  animation: hourglass-bottom 1s linear infinite;
}

@keyframes hourglass-top {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(180deg);
  }
}

@keyframes hourglass-bottom {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-180deg);
  }
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 🎯 LOGIN STYLES (Test-spezifisch) */
.login-container {
  max-width: 400px;
  margin: 40px auto;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.option-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
  width: 100%;
  max-width: 400px;
}

.option-button {
  padding: 15px 25px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  width: 100%;
  border: none;
}

.option-button.primary {
  background-color: #4caf50;
  color: white;
}

.option-button.primary:hover {
  background-color: #45a049;
  transform: translateY(-2px);
}

.option-button.secondary {
  background-color: #f5f5f5;
  color: #333;
}

.option-button.secondary:hover {
  background-color: #e9e9e9;
  transform: translateY(-2px);
}

/* 🎯 MOBILE OPTIMIERUNG (Test-spezifisch) */
@media screen and (max-width: 768px) {
  .answer-label {
    font-size: 10px !important;
    padding: 8px 3px !important;
    min-height: 35px !important;
  }

  #ki-test-container {
    padding: 15px;
    max-width: 90%;
  }

  #start-test,
  #next-question {
    font-size: 16px;
    padding: 12px 20px;
  }

  #chart-container {
    width: 95vw;
    max-height: 200px;
  }

  .option-buttons {
    padding: 0 15px;
  }

  .option-button {
    padding: 12px 20px;
    font-size: 14px;
  }
}

@media screen and (max-width: 480px) {
  #ki-test-container {
    max-width: 90%;
  }

  #next-question {
    font-size: 14px;
    padding: 8px 15px;
  }
}
