/**
 * BENGUELA B&B - BOOKING SYSTEM STYLESHEET
 * =============================================================================
 * Teaching Note: This file contains all styles specific to the booking modal
 * and availability calendar. It's separated from main.css to keep concerns
 * organized and allow selective loading if needed.
 *
 * Contents:
 *  1. Booking Modal Layout
 *  2. Room Selection Grid
 *  3. Date Picker Styles
 *  4. Availability Calendar
 *  5. Guest Form
 *  6. Booking Confirmation
 *  7. Waiting List Form
 * =============================================================================
 */

/* =============================================================================
   1. BOOKING MODAL LAYOUT
   ============================================================================= */
.booking-modal {
  max-width: 900px;
}

/* Step panels - shown/hidden based on booking progress */
.booking-panel {
  display: none;
}

.booking-panel.active {
  display: block;
  animation: fadeInUp 0.3s ease;
}

.booking-panel__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: var(--space-sm);
}

.booking-panel__subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

/* =============================================================================
   2. ROOM SELECTION GRID
   Teaching Note: Room cards in the booking modal use CSS Grid. Each card
   displays availability through CSS classes added dynamically by JavaScript.
   Confirmed/blocked rooms use pointer-events:none to prevent selection.
   ============================================================================= */
.booking-rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.booking-room-card {
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255,255,255,0.02);
  position: relative;
}

/* Available state - default */
.booking-room-card.available:hover {
  border-color: var(--teal);
  background: rgba(22, 160, 133, 0.05);
  transform: translateY(-2px);
}

.booking-room-card.selected {
  border-color: var(--teal);
  background: rgba(22, 160, 133, 0.1);
  box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.15);
}

/* Provisional state - yellow */
.booking-room-card.provisional {
  border-color: rgba(243, 156, 18, 0.4);
  background: rgba(243, 156, 18, 0.05);
}

/* Confirmed/booked state - grey, non-selectable */
.booking-room-card.confirmed,
.booking-room-card.blocked {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.booking-room-card.confirmed {
  border-color: rgba(127, 140, 141, 0.3);
}

.booking-room-card.blocked {
  border-color: rgba(192, 57, 43, 0.3);
}

/* Room image thumbnail */
.booking-room-card__img {
  height: 130px;
  overflow: hidden;
  position: relative;
}

.booking-room-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Status ribbon */
.booking-room-card__status {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.status-available { background: rgba(22, 160, 133, 0.85); color: white; }
.status-provisional { background: rgba(243, 156, 18, 0.85); color: white; }
.status-confirmed { background: rgba(127, 140, 141, 0.85); color: white; }
.status-blocked { background: rgba(192, 57, 43, 0.85); color: white; }

.booking-room-card__body {
  padding: var(--space-md);
}

.booking-room-card__name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
}

.booking-room-card__type {
  font-size: 0.72rem;
  color: var(--teal-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-sm);
}

.booking-room-card__desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.booking-room-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: var(--space-sm);
  margin-top: var(--space-sm);
}

.booking-room-card__guests {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.booking-room-card__price {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--sand);
}

/* Checkmark for selected room */
.booking-room-card::after {
  content: '✓';
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.booking-room-card.selected::after {
  opacity: 1;
}

/* =============================================================================
   3. DATE PICKER STYLES
   Teaching Note: We use a custom date range picker built with JavaScript.
   The picker uses a two-month calendar view. Styling uses the same ocean
   theme palette with distinct states for: today, in-range, start/end dates.
   ============================================================================= */
.date-picker-wrapper {
  margin-bottom: var(--space-xl);
}

.date-picker-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: var(--space-lg);
}

.date-picker-inputs .arrow {
  color: var(--text-muted);
  text-align: center;
}

.date-input-group {
  position: relative;
}

.date-input-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.date-input {
  width: 100%;
  padding: 0.75rem var(--space-md);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  color: var(--text-light);
  font-size: 0.95rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition-fast);
}

.date-input:focus {
  outline: none;
  border-color: var(--teal);
  background: rgba(22, 160, 133, 0.05);
}

/* Calendar grid */
.calendar-container {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.calendar-nav {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition-fast);
}

.calendar-nav:hover {
  background: rgba(22, 160, 133, 0.1);
  border-color: var(--teal);
  color: var(--teal-light);
}

.calendar-month-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
}

/* Two-month calendar layout */
.calendar-months {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.calendar-month {
  flex: 1;
}

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

.calendar-weekdays span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-sm) 0;
}

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

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-light);
  font-weight: 500;
  position: relative;
}

.calendar-day:hover:not(.disabled):not(.booked) {
  background: rgba(22, 160, 133, 0.15);
  color: var(--teal-light);
}

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

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

.calendar-day.selected-start,
.calendar-day.selected-end {
  background: var(--teal);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.calendar-day.in-range {
  background: rgba(22, 160, 133, 0.12);
  border-radius: 0;
  color: var(--seafoam);
}

.calendar-day.in-range:first-child,
.calendar-day.selected-start { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.calendar-day.in-range:last-child,
.calendar-day.selected-end { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Booked day states */
.calendar-day.booked-provisional {
  background: rgba(243, 156, 18, 0.2);
  color: #F39C12;
  cursor: not-allowed;
}

.calendar-day.booked-confirmed {
  background: rgba(127, 140, 141, 0.15);
  color: var(--text-muted);
  text-decoration: line-through;
  cursor: not-allowed;
}

.calendar-day.disabled {
  color: rgba(255,255,255,0.15);
  cursor: not-allowed;
}

.calendar-day.other-month {
  color: rgba(255,255,255,0.15);
  pointer-events: none;
}

/* Booking summary box */
.booking-summary {
  background: rgba(22, 160, 133, 0.05);
  border: 1px solid rgba(22, 160, 133, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
}

.booking-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.booking-summary__row:last-child {
  border-bottom: none;
  font-weight: 700;
  color: var(--sand);
  font-size: 1rem;
  padding-top: var(--space-md);
}

.booking-summary__label {
  color: var(--text-muted);
}

.booking-summary__value {
  color: var(--text-light);
  font-weight: 600;
}

/* =============================================================================
   4. GUEST FORM
   ============================================================================= */
.guest-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.guest-form-grid .full-width {
  grid-column: 1 / -1;
}

.whatsapp-send-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-lg);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.whatsapp-send-note .icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* =============================================================================
   5. AVAILABILITY UNAVAILABLE STATE
   Teaching Note: When selected dates are unavailable, we show an alternate
   panel with a waiting list form instead of the normal booking form.
   ============================================================================= */
.unavailable-panel {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
}

.unavailable-panel__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.unavailable-panel__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: var(--space-sm);
}

.unavailable-panel__text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.waiting-list-form {
  text-align: left;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid rgba(255,255,255,0.06);
}

.waiting-list-form__title {
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--sand);
}

/* =============================================================================
   6. MULTIPLE ROOM SUGGESTION
   Teaching Note: When a group is larger than any single room's capacity,
   we suggest booking multiple rooms. This panel pops up automatically.
   ============================================================================= */
.multi-room-suggestion {
  background: rgba(212, 172, 110, 0.08);
  border: 1px solid rgba(212, 172, 110, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.multi-room-suggestion__title {
  font-weight: 700;
  color: var(--sand);
  margin-bottom: var(--space-sm);
  font-size: 0.9rem;
}

.multi-room-suggestion__text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* =============================================================================
   7. BOOKING CONFIRMATION STEP
   ============================================================================= */
.booking-confirm {
  text-align: center;
}

.booking-confirm__icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  display: block;
}

.booking-confirm__details {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: left;
  margin: var(--space-xl) 0;
  border: 1px solid rgba(255,255,255,0.06);
}

.booking-confirm__room {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--teal-light);
  margin-bottom: var(--space-sm);
}

.booking-confirm__note {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Mobile responsive overrides */
@media (max-width: 640px) {
  .booking-rooms-grid {
    grid-template-columns: 1fr;
  }

  .calendar-months {
    grid-template-columns: 1fr;
  }

  .guest-form-grid {
    grid-template-columns: 1fr;
  }

  .date-picker-inputs {
    grid-template-columns: 1fr;
  }

  .date-picker-inputs .arrow {
    display: none;
  }
}
