/* Global – sicherstellen, dass Padding in der Breite enthalten ist */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Container, der die Höhe von seinem flexiblen Umfeld bekommt */
.contact-map-container {
  display: flex;
  gap: 2rem;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 1rem;
  align-items: stretch; /* Beide Bereiche erhalten die gleiche Höhe */
}

/* Bereich für die Karte */
.contact-map-container .map {
  position: relative;
  flex: 1 1 600px;
  min-width: 300px;
  /* Damit überstehende Bildteile nicht angezeigt werden */
  overflow: hidden;
}

.contact-map-container .map img,
.contact-map-container .map iframe {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  display: block;
}

/* Bereich für die schriftliche Wegbeschreibung */
.contact-map-container .directions {
  flex: 1 1 300px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-map-container .directions h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.contact-map-container .directions p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Mobile Ansicht: Karte und Text untereinander anordnen,
   hier erzwingen wir ein 3:2-Seitenverhältnis für die Karte */
@media (max-width: 768px) {
  .contact-map-container {
    flex-direction: column;
  }
  
  .contact-map-container .map {
    flex: none;
    width: calc(100% + 2rem); /* Kompensiert das Padding */
    aspect-ratio: 3 / 2;      /* Erzwingt das 3:2-Format */
    margin-top: 3.5rem;
    margin-left: -1rem;
    margin-right: -1rem;
  }
  
  .contact-map-container .map iframe {
    min-height: auto;
  }
}

/* Positioniere das Overlay im Map-Container */
.map {
  position: relative; /* Erforderlich, damit absolute Positionierung im Kind relativ zum Container erfolgt */
}

/* Overlay-Box über dem Bild – links oben, mit transparenter Hintergrundfarbe */
.map-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 0.5rem 0.5rem;
  border-radius: 5px;
  text-align: center;
  z-index: 10;
  width: 185px; /* Beispielwert – passt nach Bedarf */
  overflow: hidden; /* Falls der Inhalt etwas abschneidet */
}

/* Styling für den Text im Overlay */
.map-overlay p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-color);
}

/* Link-Styling im Overlay – an deine bestehende Farbpalette anpassen */
.map-overlay a {
  color: var(--primary-color);
  text-decoration: underline;
}

.map-overlay button {
  background-color: var(--primary-color) !important;
  color: #fff !important;
  border: none;
  width: 100%;
  display: block;
  border-radius: 5px;
  margin-top: 0.2rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* -------------------- */
/* Weitere Bereiche:   */
/* -------------------- */

.contact-interactive-container {
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.toggle-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.toggle-buttons button {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  flex: 1;
  padding: 10px;
  background-color: #f0f0f0;
  color: #000;
  cursor: pointer;
  transition: background-color 0.3s;
  border-radius: 5px;
  border: none;
  outline: none;
}

.toggle-buttons button.active {
  background-color: #560062;
  color: #fff;
}

@media screen and (max-width: 768px) {
  .contact-interactive-container {
    max-width: 100%;
    padding: 0 1rem;
  }
}

#contactForm {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#contactForm .form-row {
  margin-bottom: 1rem;
}

#contactForm label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

#contactForm input,
#contactForm select,
#contactForm textarea {
  height: 40px;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #000;
  box-sizing: border-box;
}

#contactForm select#topic,
#contactForm select#salutation,
#contactForm textarea#message,
#contactForm input[type="checkbox"] {
  height: auto;
}

#contactForm input[type="date"],
#contactForm input[type="time"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.5rem;
  font-size: 1rem;
}

#contactForm input[type="date"]::-webkit-inner-spin-button,
#contactForm input[type="date"]::-webkit-clear-button,
#contactForm input[type="time"]::-webkit-inner-spin-button,
#contactForm input[type="time"]::-webkit-clear-button {
  display: none;
}

#file-upload-container .file-upload-wrapper {
  margin-bottom: 1rem;
}

.file-upload-wrapper input[type="file"] {
  display: block;
  margin-bottom: 0.5rem;
}

.file-preview {
  max-width: 100%;
  max-height: 200px;
  margin-bottom: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 5px;
}

#contactForm .honeypot {
  display: none;
}

.checkbox-group {
  margin-bottom: 1rem;
}

.checkbox-group label {
  display: block;
  margin-bottom: 0.5rem;
}

.file-upload-wrapper {
  position: relative;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fafafa;
}

.remove-upload {
  position: absolute;
  top: 3px;
  right: 3px;
  background: transparent;
  color: #560062;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.remove-upload:hover {
  color: #560062;
}

#submitButton {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background-color: #ccc;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: not-allowed;
  transition: background-color 0.3s;
}

#submitButton.enabled {
  background-color: #560062;
  cursor: pointer;
}

#contactForm select {
  color: #000;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#contactForm select option {
  color: #000;
}

#contactForm select:focus {
  border-color: #000;
  box-shadow: none;
}

/* ======================= */
/* Spinner im Modal        */
/* ======================= */

#recaptcha-container.loading::before {
  content: "";
  display: block;
  margin: 2rem auto;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: #560062;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ======================= */
/* Modal Fenster (reCAPTCHA) */
/* ======================= */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative; /* ← Das ist der Schlüssel! */
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  text-align: center;
}

.modal-content h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.modal-content #recaptcha-container {
  margin: 1.5rem 0;
}

.modal-content button {
  background-color: #560062;
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.modal-content button:hover {
  background-color: #7a1c8e;
}

/* Ladeanimation im Modal */
#recaptcha-container.loading::before {
  content: "";
  display: block;
  margin: 1.5rem auto;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.2);
  border-top-color: #560062;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

#recaptcha-container.loading p {
  text-align: center;
  font-weight: bold;
  color: #560062;
  margin-top: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ✅ Erfolgskarte im Screenshot-Stil */
.recaptcha-success-box {
  background-color: #e6f8ec;
  color: #146c2d;
  border: 2px solid #b6e2c2;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-width: 400px;
  margin: 1.5rem auto;
  animation: fadeInZoom 0.5s ease-out;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.6;
}

.recaptcha-success-box::before {
  content: "✅";
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
  display: none !important;
}
  
  

@keyframes fadeInZoom {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ❌ Close-Button oben rechts */
.close-icon {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  background: transparent;
  border: none;
  color: #560062;
  cursor: pointer;
  z-index: 10;
}

/* 🕊️ Sanfter Fade-Out */
.modal.fade-out {
  animation: fadeOutModal 1s ease forwards;
}

@keyframes fadeOutModal {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* ❌ X-Icon oben rechts im Modal */
#modal-close-icon {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.8rem;
  font-weight: bold;
  color: #560062;
  cursor: pointer;
  z-index: 10;
}

#modal-close-icon:hover {
  color: #9900aa;
}

.contact-section h2 {
  margin-bottom: 1.5rem;
}

.contact-section h2 {
  color: var(--primary-color);
}

/* Nur Überschriften und Text direkt in .contact-section zentrieren */
.contact-section > h2,
.contact-section > p {
  text-align: center;
}
