/* Grundlayout */
body {
  font-family: 'Montserrat', sans-serif;
  background: #F7F8FA;
  color: #333333;
  margin: 0;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

header,
main {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Haupttitel */
h1 {
  font-size: clamp(1.6rem, 2.6vw, 2.6rem);
  margin-bottom: 25px;
  color: #007BFF;
  text-align: center;
}

h2 {
  font-size: clamp(1.2rem, 2.1vw, 1.8rem);
  color: #007BFF;
  margin-top: 0;
  margin-bottom: 15px;
}

.brand-logo {
  display: block;
  margin: 8px auto 16px;
  width: min(90%, 360px);
  height: auto;
}

/* Container für Kalender & Buchung */
#calendar,
#bookingInfo {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 20px;
  width: min(100%, 900px);
  max-width: 900px;
  min-width: 0;
  box-sizing: border-box;
}

/* Kalender-Grid */
#calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  grid-auto-rows: 1fr;
  background: white; /* sofort sichtbar */
}

/* Skeleton-Ladezustand */
#calendar.loading {
  min-height: 400px; /* Platz für 5 Reihen */
  background-color: #f0f0f0;
}

/* Wochentage (nur Text, keine Boxen, größer) */
.header {
  text-align: center;
  font-weight: 600;
  color: #555555;
  font-size: 16px;
  padding: 6px 0;
  border: none;
  background: none;
}

/* Standard-Tage quadratisch */
.day {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  border-radius: 8px;
  transition: background 0.3s ease;
  box-sizing: border-box;
  border: 1px solid #f0f0f0;
}

/* Gebuchte Tage */
.booked {
  background-color: #FF6B6B;
  color: white;
  cursor: not-allowed;
}

/* Verfügbare Tage */
.available {
  background-color: #F7F8FA;
  cursor: pointer;
}
.available:hover {
  background-color: #E3F2FD;
}

/* Auswahl-Range */
.in-range {
  background-color: #80D4FF;
  color: #003366;
}

/* Start- oder Enddatum */
.range-edge {
  background-color: #007BFF;
  color: white;
  font-weight: bold;
}

/* Heute */
.today {
  border: 2px solid #007BFF;
  font-weight: bold;
}

/* Leere Zellen */
.day.empty {
  border: none;
  background: none;
  cursor: default;
}

/* Navigation oben */
.controls {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.controls button {
  background: #007BFF;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 15px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
}

.controls button:hover {
  background: #0056B3;
  transform: translateY(-2px);
}

#monthYear {
  font-weight: bold;
  font-size: 18px;
}

/* Buchungsbereich */
#bookingInfo {
  min-height: 120px; /* Platz für Auswahl */
  display: grid;
  align-content: start;
  word-break: break-word;
  white-space: normal;
}

#bookingInfo h3 {
  color: #007BFF;
  margin-bottom: 10px;
}

.price-breakdown {
  margin: 12px 0 6px;
  display: grid;
  gap: 6px;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.price-total {
  font-weight: 700;
}

/* Loading indicators */
.spinner-inline {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}

.spinner-block {
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: #007BFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 12px auto;
}

.is-loading .spinner-inline {
  display: inline-block;
}

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.loading-inline .spinner-inline {
  display: inline-block;
  border-color: #007BFF;
  border-top-color: transparent;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.email-field {
  display: block;
  margin-top: 12px;
}

#bookingInfo input[type="email"] {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #E0E0E0;
  width: 100%;
  font-size: 15px;
  box-sizing: border-box;
  margin: 10px 0;
}

#bookingInfo button {
  background: #28A745;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
}

#bookingInfo button:hover {
  background: #218838;
  transform: translateY(-2px);
}

/* Hidden elements */
.hidden {
  display: none !important;
}

/* Zahlung & QR-Code */
.payment-box {
  margin: 20px 0;
  background: white;
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

#qrCode {
  max-width: 320px;
  width: 60%;
  max-height: 320px;
  display: block;
  margin: 8px auto;
}

/* kleinere Anpassung für Buttons */
.button {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  background: #007BFF;
  color: white;
  text-decoration: none;
  margin-top: 8px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
}

.button:hover {
  background: #0056B3;
  transform: translateY(-2px);
}

/* Success page container */
.booking-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 30px;
  max-width: 600px;
  width: 100%;
  text-align: center;
}

#statusBox, #paidBox, #pendingBox, #paymentBox, #errorBox {
  margin: 20px 0;
}

#qrWrapper {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #E0E0E0;
}

/* 📱 Responsive Design */
@media (max-width: 600px) {
  body {
    padding: 20px 10px;
  }

  h1 {
    font-size: 1.6rem;
  }

  #calendar {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    grid-auto-rows: 80px;
    padding: 10px;
  }

  .controls {
    flex-direction: column;
  }

  .controls button {
    width: 100%;
    font-size: 14px;
    padding: 10px;
  }

  #monthYear {
    font-size: 16px;
  }
}
