/**
 * Booking Form Styles - Természet Közeli Design
 * @package Wellness_Booking
 */

/* ==========================================================================
   Booking Form Wrapper
   ========================================================================== */

.wbs-booking-form-wrapper {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-2xl, 3rem) var(--space-lg, 1.5rem);
  background-color: var(--color-surface);
  border-radius: var(--radius-xl, 1rem);
  box-shadow: var(--shadow-lg, 0 8px 32px rgba(44, 36, 22, 0.16));
  box-sizing: border-box;
}

/* ==========================================================================
   Steps Indicator
   ========================================================================== */

.wbs-steps-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-3xl);
  position: relative;
}

.wbs-steps-indicator::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: rgba(124, 148, 115, 0.2);
  z-index: 0;
}

.wbs-step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  position: relative;
  z-index: 1;
  flex: 1;
}

.wbs-step-indicator__circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-surface);
  border: 3px solid rgba(124, 148, 115, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: all var(--transition-base);
}

.wbs-step-indicator.active .wbs-step-indicator__circle {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-color: var(--color-primary);
  color: white;
  transform: scale(1.1);
}

.wbs-step-indicator.completed .wbs-step-indicator__circle {
  background-color: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.wbs-step-indicator__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
}

.wbs-step-indicator.active .wbs-step-indicator__label {
  color: var(--color-primary-dark);
  font-weight: 600;
}

/* ==========================================================================
   Step Content
   ========================================================================== */

.wbs-step {
  display: none;
}

.wbs-step.active {
  display: block;
  animation: fadeInSlide 0.3s ease;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wbs-step h3 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  color: var(--color-text);
  margin-bottom: var(--space-xl);
  text-align: center;
}

/* ==========================================================================
   Form Fields - Organic Style
   ========================================================================== */

.wbs-form-field {
  margin-bottom: var(--space-lg);
}

.wbs-form-field label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.wbs-form-field input[type="text"],
.wbs-form-field input[type="email"],
.wbs-form-field input[type="tel"],
.wbs-form-field input[type="date"],
.wbs-form-field input[type="time"],
.wbs-form-field input[type="number"],
.wbs-form-field textarea {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 2px solid rgba(124, 148, 115, 0.2);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.wbs-form-field input:focus,
.wbs-form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(124, 148, 115, 0.1);
}

.wbs-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .wbs-form-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Services Grid (in Form)
   ========================================================================== */

.wbs-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

@media (max-width: 1024px) {
  .wbs-services-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .wbs-services-grid {
    grid-template-columns: 1fr;
  }
}

.wbs-service-card {
  background-color: var(--color-bg);
  border: 2px solid rgba(124, 148, 115, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  display: flex;
  flex-direction: column;
}

.wbs-service-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.wbs-service-card.selected {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, rgba(124, 148, 115, 0.05) 0%, rgba(124, 148, 115, 0.1) 100%);
  box-shadow: var(--shadow-md);
}

.wbs-service-card.selected::before {
  content: '✓';
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 28px;
  height: 28px;
  background-color: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ==========================================================================
   Date & Time Selection Grid (Step 2)
   ========================================================================== */

.wbs-selected-service-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid rgba(124, 148, 115, 0.15);
}

.wbs-selected-service-header h3 {
  margin-bottom: var(--space-md);
}

.wbs-selected-service-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.wbs-selected-service-name {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary-dark);
}

.wbs-change-service {
  background: none;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.wbs-change-service:hover {
  background-color: var(--color-primary);
  color: white;
}

.wbs-datetime-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: var(--space-lg, 1.5rem);
  margin-bottom: var(--space-2xl, 3rem);
  max-width: 100%;
  overflow: hidden;
}

/* Force single column on mobile and tablet */
@media (max-width: 900px) {
  .wbs-datetime-grid {
    grid-template-columns: 1fr !important;
    grid-auto-flow: row !important; /* Stack vertically */
    gap: var(--space-lg, 1.5rem);
  }
}

.wbs-calendar-section,
.wbs-timeslots-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md, 1rem);
  min-width: 0; /* Critical: allows grid items to shrink below content size */
  max-width: 100%; /* Prevents overflow */
  overflow: hidden; /* Hides any overflow */
}

.wbs-calendar-section h4,
.wbs-timeslots-section h4 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--color-primary-dark);
  margin: 0;
}

/* Inline Calendar Styling */
.wbs-calendar-wrapper {
  background-color: var(--color-bg);
  border: 2px solid rgba(124, 148, 115, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#wbs-calendar-inline {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Calendar Header */
.wbs-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid rgba(124, 148, 115, 0.15);
}

.wbs-calendar-month-year {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary-dark);
}

.wbs-calendar-prev,
.wbs-calendar-next {
  background: none;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: var(--text-xl);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.wbs-calendar-prev:hover,
.wbs-calendar-next:hover {
  background-color: var(--color-primary);
  color: white;
  transform: scale(1.05);
}

/* Calendar Body */
.wbs-calendar-body {
  width: 100%;
}

.wbs-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.wbs-calendar-weekday {
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary-dark);
  padding: var(--space-xs);
}

.wbs-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-xs);
}


.wbs-calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  font-weight: 500;
  background-color: white;
  border: 2px solid rgba(124, 148, 115, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.wbs-calendar-day:hover:not(.wbs-calendar-day-disabled):not(.wbs-calendar-day-empty) {
  border-color: var(--color-primary);
  background-color: rgba(124, 148, 115, 0.05);
  transform: scale(1.05);
}

.wbs-calendar-day-today {
  border-color: var(--color-secondary);
  font-weight: 700;
  color: var(--color-secondary);
}

.wbs-calendar-day-selected {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-color: var(--color-primary);
  color: white;
  font-weight: 700;
}

.wbs-calendar-day-disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.wbs-calendar-day-empty {
  background: transparent;
  border: none;
  cursor: default;
  pointer-events: none;
}

/* Selected Date Display */
.wbs-selected-date-display {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  background-color: rgba(124, 148, 115, 0.08);
  border-radius: var(--radius-md);
  text-align: center;
  display: none;
}

.wbs-selected-date-display.visible {
  display: block;
}

/* Timeslots Bubbles Container */
.wbs-timeslots-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  max-height: 400px;
  overflow-y: auto;
  padding: var(--space-md);
  background-color: var(--color-bg);
  border: 2px solid rgba(124, 148, 115, 0.15);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.wbs-select-date-prompt {
  width: 100%;
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
  padding: var(--space-xl);
}

/* Individual Timeslot Bubble */
.wbs-timeslot-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  background-color: white;
  border: 2px solid rgba(124, 148, 115, 0.25);
  border-radius: var(--radius-full);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.wbs-timeslot-bubble:hover {
  border-color: var(--color-primary);
  background-color: rgba(124, 148, 115, 0.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.wbs-timeslot-bubble.selected {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-color: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.wbs-timeslot-bubble.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Step Actions */
.wbs-step-actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .wbs-timeslots-bubbles {
    max-height: 300px;
  }

  .wbs-selected-service-info {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .wbs-timeslot-bubble {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-sm);
  }

  .wbs-step-actions {
    flex-direction: column-reverse;
  }

  .wbs-step-actions button {
    width: 100%;
  }
}

/* ==========================================================================
   Timeslots
   ========================================================================== */

.wbs-timeslots-wrapper {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xl);
}

#wbs-timeslots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-md);
}

.wbs-timeslot {
  padding: var(--space-md);
  text-align: center;
  font-weight: 500;
  background-color: var(--color-bg);
  border: 2px solid rgba(124, 148, 115, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.wbs-timeslot:hover {
  border-color: var(--color-primary);
  background-color: rgba(124, 148, 115, 0.05);
}

.wbs-timeslot.selected {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-color: var(--color-primary);
  color: white;
}

.wbs-timeslot.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   Booking Summary
   ========================================================================== */

.wbs-booking-summary {
  background: linear-gradient(135deg, rgba(124, 148, 115, 0.05) 0%, rgba(124, 148, 115, 0.1) 100%);
  border: 2px solid rgba(124, 148, 115, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.wbs-booking-summary h4 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
  color: var(--color-primary-dark);
}

#wbs-summary-content {
  display: grid;
  gap: var(--space-md);
}

.wbs-summary-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(124, 148, 115, 0.15);
}

.wbs-summary-item:last-child {
  border-bottom: none;
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--color-primary-dark);
}

/* ==========================================================================
   Payment Methods
   ========================================================================== */

.wbs-payment-methods {
  margin-bottom: var(--space-xl);
}

.wbs-payment-methods h4 {
  margin-bottom: var(--space-lg);
}

.wbs-payment-method {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background-color: var(--color-bg);
  border: 2px solid rgba(124, 148, 115, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.wbs-payment-method:hover {
  border-color: var(--color-primary);
}

.wbs-payment-method input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
}

.wbs-payment-method span {
  font-weight: 500;
  flex: 1;
}

/* ==========================================================================
   Form Navigation Buttons
   ========================================================================== */

.wbs-form-actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
}

.wbs-btn-prev,
.wbs-btn-next,
#wbs-submit-booking {
  padding: var(--space-md) var(--space-2xl);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
}

.wbs-btn-prev {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.wbs-btn-prev:hover {
  background-color: rgba(124, 148, 115, 0.1);
}

.wbs-btn-next,
#wbs-submit-booking {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}

.wbs-btn-next:hover,
#wbs-submit-booking:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.wbs-btn-next:disabled,
#wbs-submit-booking:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   Messages
   ========================================================================== */

#wbs-messages {
  margin-bottom: var(--space-xl);
}

.wbs-message {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.wbs-message--success {
  background-color: rgba(107, 142, 90, 0.1);
  border: 2px solid var(--color-success);
  color: var(--color-success);
}

.wbs-message--error {
  background-color: rgba(201, 124, 93, 0.1);
  border: 2px solid var(--color-error);
  color: var(--color-error);
}

.wbs-message--info {
  background-color: rgba(124, 148, 115, 0.1);
  border: 2px solid var(--color-primary);
  color: var(--color-primary-dark);
}

/* ==========================================================================
   Loading Overlay
   ========================================================================== */

.wbs-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(44, 36, 22, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.wbs-loading-spinner {
  width: 64px;
  height: 64px;
  border: 6px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: wellness-spin 0.8s linear infinite;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .wbs-booking-form-wrapper {
    padding: var(--space-xl) var(--space-md);
  }

  .wbs-step h3 {
    font-size: var(--text-2xl);
  }

  .wbs-steps-indicator {
    font-size: var(--text-xs);
  }

  .wbs-step-indicator__circle {
    width: 32px;
    height: 32px;
  }

  #wbs-timeslots {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .wbs-form-actions {
    flex-direction: column-reverse;
  }

  .wbs-btn-prev,
  .wbs-btn-next,
  #wbs-submit-booking {
    width: 100%;
  }
}
