/* Booking Engine Component
   Three-stage booking widget: Calendar → Sessions → Booking Panel
   ============================================================== */

/* Container */
.booking-engine {
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  max-width: 400px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.booking-engine--dark {
  background: var(--grey-900, #1a1a1a);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* ================================
   Stage 1: Mini Calendar
   ================================ */
.booking-calendar {
  padding: 20px;
}

/* Calendar Navigation */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-nav-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--grey-100, #f5f5f5);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  font-size: 0.9rem;
  color: var(--grey-600, #666);
}

.calendar-nav-btn:hover {
  background: var(--grey-200, #e5e5e5);
  transform: scale(1.05);
}

.calendar-nav-btn:active {
  transform: scale(0.95);
}

.booking-engine--dark .calendar-nav-btn {
  background: var(--grey-700, #404040);
  color: var(--grey-300, #ccc);
}

.calendar-nav-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--grey-800, #333);
}

.booking-engine--dark .calendar-nav-title {
  color: var(--grey-100, #f5f5f5);
}

/* Mini Calendar Grid */
.calendar-mini-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-mini-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.mini-weekday {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--grey-500, #888);
  padding: 4px 0;
}

.booking-engine--dark .mini-weekday {
  color: var(--grey-400, #999);
}

.calendar-mini-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* Day cells */
.mini-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--grey-700, #444);
  background: transparent;
  border-radius: 50%;
  cursor: default;
  position: relative;
  transition: all 0.15s;
}

.booking-engine--dark .mini-day {
  color: var(--grey-300, #ccc);
}

/* Empty cells */
.mini-day--empty {
  visibility: hidden;
}

/* Past days */
.mini-day--past {
  color: var(--grey-300, #ccc);
}

.booking-engine--dark .mini-day--past {
  color: var(--grey-600, #555);
}

/* Today */
.mini-day--today {
  font-weight: 700;
  color: var(--primary, #2a9d8f);
}

/* Days with sessions - clickable */
.mini-day--available {
  cursor: pointer;
  font-weight: 600;
  color: var(--grey-800, #333);
  background: var(--grey-100, #f5f5f5);
}

.booking-engine--dark .mini-day--available {
  color: var(--grey-100, #f5f5f5);
  background: var(--grey-700, #404040);
}

.mini-day--available:hover {
  background: var(--primary-light, #d4f0ed);
  color: var(--primary-dark, #1d7a6f);
  transform: scale(1.1);
}

.booking-engine--dark .mini-day--available:hover {
  background: var(--primary, #2a9d8f);
  color: #fff;
}

/* Session indicator dot */
.mini-day--available::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary, #2a9d8f);
}

/* Selected day */
.mini-day--selected {
  background: var(--primary, #2a9d8f) !important;
  color: #fff !important;
  font-weight: 700;
}

.mini-day--selected::after {
  background: rgba(255, 255, 255, 0.8);
}

/* ================================
   Stage 2: Session List
   ================================ */
.booking-sessions {
  padding: 16px 20px;
  border-top: 1px solid var(--grey-200, #e5e5e5);
}

.booking-engine--dark .booking-sessions {
  border-top-color: var(--grey-700, #404040);
}

.sessions-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sessions-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--grey-500, #888);
}

.sessions-date {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--grey-700, #444);
}

.booking-engine--dark .sessions-date {
  color: var(--grey-300, #ccc);
}

.sessions-placeholder {
  font-size: 0.85rem;
  color: var(--grey-400, #999);
  text-align: center;
  padding: 16px 0;
}

/* Session list */
.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Session item */
.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--grey-50, #fafafa);
  border: 1px solid var(--grey-200, #e5e5e5);
  border-radius: 10px;
  transition: all 0.2s;
}

.session--available {
  cursor: pointer;
}

.session--available:hover {
  background: #fff;
  border-color: var(--primary, #2a9d8f);
  box-shadow: 0 2px 8px rgba(42, 157, 143, 0.15);
  transform: translateY(-1px);
}

.session--full {
  opacity: 0.6;
  cursor: not-allowed;
}

.booking-engine--dark .session-item {
  background: var(--grey-800, #2a2a2a);
  border-color: var(--grey-700, #404040);
}

.booking-engine--dark .session--available:hover {
  background: var(--grey-750, #353535);
  border-color: var(--primary, #2a9d8f);
}

.session-time {
  font-size: 1rem;
  font-weight: 600;
  color: var(--grey-800, #333);
}

.booking-engine--dark .session-time {
  color: var(--grey-100, #f5f5f5);
}

.session-seats {
  font-size: 0.8rem;
  color: var(--grey-500, #888);
  margin-left: auto;
  margin-right: 12px;
}

.session-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary, #2a9d8f);
}

/* Selected session */
.session--selected {
  background: var(--primary-light, #e8f5f3) !important;
  border-color: var(--primary, #2a9d8f) !important;
}

.booking-engine--dark .session--selected {
  background: rgba(42, 157, 143, 0.2) !important;
}

/* ================================
   Stage 3: Booking Panel
   ================================ */
.booking-panel {
  padding: 16px 20px;
  border-top: 1px solid var(--grey-200, #e5e5e5);
}

.booking-engine--dark .booking-panel {
  border-top-color: var(--grey-700, #404040);
}

.panel-header {
  margin-bottom: 12px;
}

.panel-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--grey-500, #888);
}

/* Panel details */
.panel-details {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--grey-100, #f0f0f0);
}

.booking-engine--dark .panel-details {
  border-bottom-color: var(--grey-700, #404040);
}

.panel-workshop-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--grey-800, #333);
  margin-bottom: 4px;
}

.booking-engine--dark .panel-workshop-title {
  color: var(--grey-100, #f5f5f5);
}

.panel-session-info {
  display: flex;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary, #2a9d8f);
}

.panel-venue,
.panel-duration {
  font-size: 0.8rem;
  color: var(--grey-500, #888);
  display: inline;
}

.panel-venue::after {
  content: ' · ';
}

/* Quantity selector */
.panel-quantity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.quantity-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--grey-600, #666);
}

.booking-engine--dark .quantity-label {
  color: var(--grey-400, #999);
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quantity-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--grey-300, #ddd);
  background: #fff;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--grey-700, #444);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.quantity-btn:hover:not(:disabled) {
  border-color: var(--primary, #2a9d8f);
  color: var(--primary, #2a9d8f);
}

.quantity-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.booking-engine--dark .quantity-btn {
  background: var(--grey-800, #2a2a2a);
  border-color: var(--grey-600, #555);
  color: var(--grey-300, #ccc);
}

.quantity-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--grey-800, #333);
  min-width: 32px;
  text-align: center;
}

.booking-engine--dark .quantity-value {
  color: var(--grey-100, #f5f5f5);
}

.quantity-available {
  font-size: 0.8rem;
  color: var(--grey-500, #888);
  margin-left: auto;
}

/* Price total */
.panel-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--grey-50, #fafafa);
  border-radius: 10px;
  margin-bottom: 16px;
}

.booking-engine--dark .panel-total {
  background: var(--grey-800, #2a2a2a);
}

.total-calc {
  font-size: 0.9rem;
  color: var(--grey-600, #666);
}

.booking-engine--dark .total-calc {
  color: var(--grey-400, #999);
}

.total-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary, #2a9d8f);
}

/* Checkout button */
.booking-checkout-btn {
  width: 100%;
  padding: 16px 24px;
  border: none;
  background: var(--primary, #2a9d8f);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.booking-checkout-btn:hover:not(:disabled) {
  background: var(--primary-dark, #238b7e);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42, 157, 143, 0.3);
}

.booking-checkout-btn:active:not(:disabled) {
  transform: translateY(0);
}

.booking-checkout-btn:disabled {
  background: var(--grey-400, #999);
  cursor: not-allowed;
}

/* Secure payment note */
.booking-note {
  text-align: center;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--grey-500, #888);
}

/* ================================
   Responsive Adjustments
   ================================ */
@media (max-width: 480px) {
  .booking-engine {
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid var(--grey-200, #e5e5e5);
  }

  .mini-day {
    font-size: 0.8rem;
  }

  .session-item {
    padding: 12px 14px;
  }
}

/* ================================
   Animation Helpers
   ================================ */
.booking-calendar,
.booking-sessions,
.booking-panel {
  animation: fadeSlideIn 0.25s ease-out;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
