/* ============================================================
   Jedermann. Restaurant — Reservierungssystem
   Design: Dark Theme mit Gold-Akzenten
   Schriften: Oswald (Headlines) + Inter (Body)
   ============================================================ */

/* === CSS-Variablen === */
:root {
  --bg-primary:    #0a0a0a;
  --bg-secondary:  #1a1a1a;
  --bg-tertiary:   #2a2a2a;
  --gold:          #c8a96e;
  --gold-light:    #d4ba82;
  --gold-dark:     #a08050;
  --text-primary:  #f5f5f5;
  --text-secondary:#a0a0a0;
  --text-muted:    #666666;
  --border:        #333333;
  --success:       #4caf50;
  --warning:       #ff9800;
  --danger:        #f44336;
  --info:          #2196f3;
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     12px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --transition:    0.3s cubic-bezier(.25,.8,.25,1);
}

/* === Reset für Widget-Bereich === */
.jm-reservation-wrapper {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.jm-reservation-wrapper *,
.jm-reservation-wrapper *::before,
.jm-reservation-wrapper *::after {
  box-sizing: border-box;
}

/* === Überschriften === */
.jm-reservation-wrapper h2,
.jm-reservation-wrapper h3 {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin: 0 0 16px 0;
}

.jm-reservation-wrapper h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  text-align: center;
}

.jm-reservation-wrapper h3 {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
}

/* ============================================================
   SECTION: Haupt-Layout
   ============================================================ */
.jm-section-header {
  text-align: center;
  margin-bottom: 40px;
}

.jm-section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

.jm-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

@media (min-width: 900px) {
  .jm-main-grid {
    grid-template-columns: 1fr 380px;
  }
}

/* ============================================================
   SECTION: Kalender
   ============================================================ */
.jm-calendar-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.jm-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.jm-calendar-header h3 {
  margin: 0;
  font-size: 1.3rem;
}

.jm-calendar-nav {
  display: flex;
  gap: 8px;
}

.jm-calendar-nav button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
}

.jm-calendar-nav button:hover {
  background: var(--gold);
  color: var(--bg-primary);
  border-color: var(--gold);
}

/* Kalender Grid */
.jm-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.jm-calendar-weekdays span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 0;
}

.jm-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.jm-calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  border: 1px solid transparent;
}

.jm-calendar-day:hover:not(.jm-day-disabled):not(.jm-day-empty) {
  background: var(--bg-tertiary);
  border-color: var(--gold);
}

.jm-day-empty {
  cursor: default;
}

.jm-day-today {
  border-color: var(--gold-dark) !important;
}

.jm-day-today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.jm-day-available {
  color: var(--text-primary);
}

.jm-day-available::before {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.jm-day-limited::before {
  background: var(--warning);
}

.jm-day-full {
  color: var(--text-muted);
  text-decoration: line-through;
  cursor: default;
}

.jm-day-full::before {
  background: var(--danger);
}

.jm-day-closed {
  color: var(--text-muted);
  cursor: default;
  opacity: 0.4;
}

.jm-day-disabled {
  color: var(--text-muted);
  opacity: 0.3;
  cursor: default;
}

.jm-day-selected {
  background: var(--gold) !important;
  color: var(--bg-primary) !important;
  font-weight: 700;
  border-color: var(--gold-light) !important;
}

.jm-day-selected::before {
  display: none;
}

/* Legende */
.jm-calendar-legend {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.jm-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.jm-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.jm-legend-dot.available { background: var(--success); }
.jm-legend-dot.limited   { background: var(--warning); }
.jm-legend-dot.full      { background: var(--danger); }

/* ============================================================
   SECTION: Zeitslots
   ============================================================ */
.jm-timeslots-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.jm-timeslots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.jm-timeslot {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.jm-timeslot:hover {
  border-color: var(--gold);
  background: rgba(200, 169, 110, 0.1);
}

.jm-timeslot.selected {
  background: var(--gold);
  color: var(--bg-primary);
  border-color: var(--gold-light);
  font-weight: 700;
}

.jm-timeslot.unavailable {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.jm-timeslot-info {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.jm-timeslot.selected .jm-timeslot-info {
  color: var(--bg-tertiary);
}

/* ============================================================
   SECTION: Buchungsformular
   ============================================================ */
.jm-booking-form-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.jm-form-group {
  margin-bottom: 20px;
}

.jm-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.jm-form-group label .required {
  color: var(--gold);
}

.jm-input,
.jm-select,
.jm-textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  padding: 12px 16px;
  transition: border-color var(--transition);
}

.jm-input:focus,
.jm-select:focus,
.jm-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(200, 169, 110, 0.15);
}

.jm-input::placeholder,
.jm-textarea::placeholder {
  color: var(--text-muted);
}

.jm-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.jm-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Personen-Stepper */
.jm-party-stepper {
  display: flex;
  align-items: center;
  gap: 0;
}

.jm-party-stepper button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.jm-party-stepper button:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.jm-party-stepper button:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.jm-party-stepper button:hover {
  background: var(--gold);
  color: var(--bg-primary);
  border-color: var(--gold);
}

.jm-party-stepper .jm-party-count {
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  height: 44px;
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

/* DSGVO Checkbox */
.jm-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.jm-checkbox-group input[type="checkbox"] {
  accent-color: var(--gold);
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.jm-checkbox-group label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin-bottom: 0;
}

.jm-checkbox-group a {
  color: var(--gold);
  text-decoration: underline;
}

/* Submit Button */
.jm-submit-btn {
  width: 100%;
  background: var(--gold);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 24px;
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 8px;
}

.jm-submit-btn:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(200, 169, 110, 0.3);
}

.jm-submit-btn:active {
  transform: translateY(0);
}

.jm-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.jm-submit-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.jm-submit-btn.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--bg-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: jm-spin 0.6s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}

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

/* ============================================================
   SECTION: Bestätigungsseite
   ============================================================ */
.jm-confirmation {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.jm-confirmation-icon {
  width: 64px;
  height: 64px;
  background: rgba(76, 175, 80, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
}

.jm-confirmation h2 {
  color: var(--success);
  margin-bottom: 12px;
}

.jm-confirmation-details {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 24px auto;
  max-width: 400px;
  text-align: left;
}

.jm-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.jm-detail-row:last-child {
  border-bottom: none;
}

.jm-detail-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.jm-detail-value {
  font-weight: 600;
  color: var(--text-primary);
}

.jm-confirmation-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.jm-btn-outline {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.jm-btn-outline:hover {
  background: rgba(200, 169, 110, 0.1);
}

/* ============================================================
   SECTION: Event-Karten
   ============================================================ */
.jm-events-section {
  margin-top: 48px;
}

.jm-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.jm-event-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.jm-event-card:hover {
  border-color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.jm-event-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  display: block;
}
.jm-event-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.jm-event-card:hover .jm-event-image img {
  transform: scale(1.05);
}

.jm-event-image-placeholder {
  width: 100%;
  height: 0px;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.jm-event-header {
  padding: 16px 20px 0;
}

.jm-event-tag {
  display: inline-block;
  background: rgba(200,169,110,0.15);
  color: var(--gold);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.jm-event-upsell {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 16px;
}

.jm-event-content {
  padding: 20px;
}

.jm-event-date {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.jm-event-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.jm-event-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.jm-event-cta {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}

.jm-event-cta:hover {
  background: var(--gold);
  color: var(--bg-primary);
}

/* Event-Karten als klickbare Links */
.jm-event-card-link {
  text-decoration: none !important;
  color: inherit !important;
  display: block;
}
.jm-event-card-link:hover .jm-event-card {
  border-color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.jm-event-card-link:hover .jm-event-cta {
  background: var(--gold);
  color: var(--bg-primary);
}

/* ============================================================
   SECTION: Meldungen
   ============================================================ */
.jm-alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.jm-alert-error {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #ff6b6b;
}

.jm-alert-success {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #66bb6a;
}

.jm-alert-info {
  background: rgba(33, 150, 243, 0.1);
  border: 1px solid rgba(33, 150, 243, 0.3);
  color: #42a5f5;
}

.jm-alert-warning {
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.3);
  color: #ffa726;
}

/* ============================================================
   SECTION: Pause-Modus
   ============================================================ */
.jm-pause-overlay {
  text-align: center;
  padding: 64px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.jm-pause-overlay h2 {
  color: var(--text-secondary);
}

/* ============================================================
   SECTION: Lade-Animation
   ============================================================ */
.jm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 8px;
}

.jm-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: jm-bounce 1.2s infinite;
}

.jm-loading-dot:nth-child(2) { animation-delay: 0.15s; }
.jm-loading-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes jm-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .jm-reservation-wrapper {
    padding: 0 12px;
  }

  .jm-calendar-card,
  .jm-timeslots-card,
  .jm-booking-form-card {
    padding: 16px;
  }

  .jm-calendar-day {
    font-size: 0.8rem;
  }

  .jm-timeslots-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .jm-events-grid {
    grid-template-columns: 1fr;
  }

  .jm-confirmation-actions {
    flex-direction: column;
  }

  .jm-btn-outline {
    width: 100%;
    justify-content: center;
  }
}
