/* =============================================
   REAL-TIME BOOKING COMPONENT STYLES
   ============================================= */

/* Progress Step Indicator */
.booking-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin: 0 auto 2rem;
  max-width: 450px;
  padding: 0 1rem;
}

.booking-steps::before {
  content: "";
  position: absolute;
  top: 1.25rem;
  left: 2.5rem;
  right: 2.5rem;
  height: 2px;
  background: var(--line);
  z-index: 0;
}

.booking-step-indicator {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.booking-step-indicator .step-num {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--surface-strong);
  border: 2px solid var(--line);
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  transition: all 250ms ease;
}

.booking-step-indicator .step-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-soft);
  transition: all 250ms ease;
}

.booking-step-indicator.active .step-num {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 8px 20px rgba(21, 94, 239, 0.25);
}

.booking-step-indicator.active .step-label {
  color: #fff;
}

.booking-step-indicator.completed .step-num {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}

/* Wizard Views & Transitions */
.booking-view {
  transition: opacity 220ms ease, transform 220ms ease;
  opacity: 1;
  transform: translateY(0);
}

.booking-view[hidden] {
  display: none !important;
  opacity: 0;
  transform: translateY(10px);
}

/* Back Navigation Buttons */
.booking-back-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.back-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 150ms ease;
  padding: 0;
}

.back-btn:hover {
  color: #fff;
}

.selected-date-display, .selected-slot-summary {
  font-size: 0.92rem;
  color: #fff;
}

.selected-slot-summary strong {
  color: var(--blue-deep);
}

/* Calendar Month Navigation Header */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0 0.25rem;
}

.calendar-month-year {
  font-family: "Outfit", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.cal-btn {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, border-color 150ms ease;
}

.cal-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.cal-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Weekday Grid */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
}

.calendar-weekdays span {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Days Grid Layout */
.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  min-height: 230px;
}

/* Day Button States */
.day-btn {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: all 180ms ease;
  padding: 0;
}

.day-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.day-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.day-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  background: transparent;
  border-color: transparent;
  color: rgba(255, 255, 255, 0.3);
}

/* Empty days padding */
.day-empty {
  aspect-ratio: 1;
  pointer-events: none;
}

/* Indicator dots for availability states */
.day-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  position: absolute;
  bottom: 6px;
}

/* Day status variations */
.day-btn[data-status="open"] {
  border-color: rgba(37, 211, 102, 0.25);
  background: rgba(37, 211, 102, 0.05);
}
.day-btn[data-status="open"] .day-indicator {
  background: #25d366;
}

.day-btn[data-status="limited"] {
  border-color: rgba(255, 175, 0, 0.3);
  background: rgba(255, 175, 0, 0.05);
}
.day-btn[data-status="limited"] .day-indicator {
  background: #ffa500;
}

.day-btn[data-status="full"] {
  border-color: rgba(224, 50, 43, 0.2);
  color: rgba(255, 255, 255, 0.4);
}
.day-btn[data-status="full"] .day-indicator {
  background: var(--red);
}

/* Selected state */
.day-btn.selected {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue)) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
  box-shadow: 0 8px 16px rgba(21, 94, 239, 0.35);
  transform: translateY(-2px);
}
.day-btn.selected .day-indicator {
  background: #fff !important;
}

/* Calendar Legend Styling */
.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  margin-top: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot--open { background: #25d366; }
.legend-dot--limited { background: #ffa500; }
.legend-dot--full { background: var(--red); }

/* Hours/Slots Grid */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.slot-btn {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 160ms ease;
}

.slot-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.03);
}

.slot-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.slot-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.05);
}

.slot-btn.selected {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue)) !important;
  border-color: var(--blue) !important;
  box-shadow: 0 6px 12px rgba(21, 94, 239, 0.25);
}

.no-slots-msg {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Skeletons Pulsing Animations */
@keyframes skeletonPulse {
  0% { opacity: 0.35; }
  50% { opacity: 0.75; }
  100% { opacity: 0.35; }
}

.skeleton-box {
  animation: skeletonPulse 1.4s infinite ease-in-out;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  aspect-ratio: 1;
}

.slots-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.6rem;
}

.skeleton-btn {
  animation: skeletonPulse 1.4s infinite ease-in-out;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  height: 2.75rem;
}

/* Booking Details Success Box */
.booking-details-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
}

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

.detail-row span {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
}

.detail-row strong {
  color: #fff;
  font-family: "Outfit", sans-serif;
  letter-spacing: 0.01em;
}

#conf-code {
  font-size: 0.84rem;
  color: var(--blue-deep);
  background: rgba(21, 94, 239, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  word-break: break-all;
  max-width: 60%;
  text-align: right;
}

/* Error Banner overlay */
.booking-error-banner {
  background: rgba(224, 50, 43, 0.12);
  border: 1px solid rgba(224, 50, 43, 0.35);
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 1rem;
}

.booking-error-banner[hidden] {
  display: none !important;
}

.error-msg-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.86rem;
  font-weight: 700;
}

.error-retry-btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 150ms ease;
  white-space: nowrap;
}

.error-retry-btn:hover {
  background: var(--red-deep);
}

/* Form spinner loader inside submit button */
.button-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: buttonSpin 1s ease-in-out infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

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

/* Dark mode overrides explicitly */
[data-theme="light"] .booking-steps::before {
  background: rgba(16, 37, 66, 0.15);
}

[data-theme="light"] .booking-step-indicator .step-num {
  background: #f0f4f9;
  border-color: rgba(16, 37, 66, 0.12);
  color: #51657d;
}

[data-theme="light"] .booking-step-indicator.active .step-num {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  border-color: var(--blue);
  color: #fff;
}

[data-theme="light"] .calendar-month-year,
[data-theme="light"] .calendar-weekdays span,
[data-theme="light"] .selected-date-display,
[data-theme="light"] .selected-slot-summary {
  color: var(--text);
}

[data-theme="light"] .cal-btn {
  border-color: rgba(16, 37, 66, 0.15);
  background: rgba(16, 37, 66, 0.05);
  color: var(--text);
}

[data-theme="light"] .cal-btn:hover:not(:disabled) {
  background: rgba(16, 37, 66, 0.12);
}

[data-theme="light"] .day-btn {
  background: #fff;
  border-color: rgba(16, 37, 66, 0.1);
  color: var(--text);
}

[data-theme="light"] .day-btn:hover:not(:disabled) {
  background: #f0f5fd;
  border-color: rgba(21, 94, 239, 0.25);
}

[data-theme="light"] .day-btn:disabled {
  background: #fcfcfc;
  color: rgba(16, 37, 66, 0.3);
  border-color: transparent;
}

[data-theme="light"] .day-btn[data-status="full"] {
  border-color: rgba(224, 50, 43, 0.15);
  color: rgba(16, 37, 66, 0.4);
}

[data-theme="light"] .calendar-legend {
  background: #f0f4f9;
}

[data-theme="light"] .legend-item {
  color: var(--text-soft);
}

[data-theme="light"] .slot-btn {
  background: #fff;
  border-color: rgba(16, 37, 66, 0.15);
  color: var(--text);
}

[data-theme="light"] .slot-btn:hover:not(:disabled) {
  background: #f0f5fd;
  border-color: rgba(21, 94, 239, 0.3);
}

[data-theme="light"] .slot-btn:disabled {
  background: transparent;
  border-color: rgba(16, 37, 66, 0.05);
  color: rgba(16, 37, 66, 0.2);
}

[data-theme="light"] .slot-btn.selected,
[data-theme="light"] .day-btn.selected {
  color: #fff !important;
}

[data-theme="light"] .no-slots-msg {
  color: var(--text-soft);
  background: rgba(16, 37, 66, 0.03);
  border-color: rgba(16, 37, 66, 0.1);
}

[data-theme="light"] .skeleton-box,
[data-theme="light"] .skeleton-btn {
  background: rgba(16, 37, 66, 0.08);
}

[data-theme="light"] .booking-details-box {
  background: #f8fafc;
  border-color: rgba(16, 37, 66, 0.08);
}

[data-theme="light"] .detail-row {
  border-bottom-color: rgba(16, 37, 66, 0.06);
}

[data-theme="light"] .detail-row span {
  color: var(--text-soft);
}

[data-theme="light"] .detail-row strong {
  color: var(--text);
}

[data-theme="light"] .back-btn {
  color: var(--text-soft);
}

[data-theme="light"] .back-btn:hover {
  color: var(--text);
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  .booking-steps {
    margin-bottom: 1.5rem;
  }
  .booking-steps::before {
    top: 1.05rem;
    left: 1.8rem;
    right: 1.8rem;
  }
  .booking-step-indicator .step-num {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 0.85rem;
  }
  .booking-step-indicator .step-label {
    font-size: 0.72rem;
  }
  .calendar-days-grid {
    gap: 0.25rem;
    min-height: 190px;
  }
  .day-btn {
    border-radius: 8px;
    font-size: 0.86rem;
  }
  .day-indicator {
    width: 4px;
    height: 4px;
    bottom: 4px;
  }
  .slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.45rem;
  }
  .slot-btn {
    min-height: 2.5rem;
    font-size: 0.85rem;
  }
  .appt-form__row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}
