/* ==========================================================================
   Shamwari Guide PWA - css/bookings.css
   Styles scoped to the bookings feature (js/features/bookings.js).
   Every selector is prefixed .sg-bk- to avoid clashing with other features
   or with the shared app.css component classes.
   ========================================================================== */

/* ---------- quick action grid (GuideHome) -------------------------------- */
.sg-bk-quickgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--sg-border);
  border-radius: var(--sg-r-md);
  overflow: hidden;
}
.sg-bk-quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sg-s-xs);
  min-height: 84px;
  padding: var(--sg-s-md);
  border: 0;
  background: var(--sg-surface);
  color: var(--sg-text);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sg-bk-quick:active { background: var(--sg-surface-variant); }

/* ---------- cancellation alert card (GuideHome) -------------------------- */
.sg-bk-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sg-s-sm);
  width: 100%;
  padding: var(--sg-s-md);
  border: 1px solid var(--sg-danger);
  background: var(--sg-danger-container);
  color: var(--sg-on-danger-container);
  border-radius: var(--sg-r-md);
  text-align: left;
  cursor: pointer;
}
.sg-bk-alert .sg-inline-icon { flex: 0 0 auto; color: var(--sg-danger); }

/* ---------- inline warning banner (capture / detail) --------------------- */
.sg-bk-warning {
  padding: var(--sg-s-md);
  border-radius: var(--sg-r-md);
  border: 1px solid var(--sg-warning);
  background: var(--sg-warning-container);
  color: var(--sg-on-warning-container);
  font-size: 13px;
  line-height: 18px;
}

/* ---------- booking card (shared across Home / List / Admin) ------------- */
.sg-bk-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: var(--sg-s-md);
  border: 1px solid var(--sg-card-border);
  border-radius: var(--sg-r-md);
  background: var(--sg-surface);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
}
.sg-bk-card:active { background: var(--sg-surface-variant); }
.sg-bk-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sg-s-sm);
}
.sg-bk-card__ref {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--sg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sg-bk-card__exp {
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  overflow-wrap: anywhere;
}
.sg-bk-card__meta {
  font-size: 13px;
  line-height: 18px;
  color: var(--sg-muted);
  overflow-wrap: anywhere;
}
.sg-bk-card__guide { color: var(--sg-tertiary); font-weight: 600; }
.sg-bk-card__cancel { color: var(--sg-danger); }

/* ---------- date chips (Availability) ------------------------------------ */
.sg-bk-datechips {
  display: flex;
  gap: var(--sg-s-sm);
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sg-bk-datechips::-webkit-scrollbar { display: none; }
.sg-bk-datechip {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 var(--sg-s-lg);
  border-radius: var(--sg-r-pill);
  border: 1px solid var(--sg-border);
  background: var(--sg-surface);
  color: var(--sg-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sg-bk-datechip.is-active {
  background: var(--sg-primary);
  border-color: var(--sg-primary);
  color: var(--sg-on-primary);
}
.sg-bk-datechip.is-disabled, .sg-bk-datechip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- quick filter chips (AdminBookings, BO-003) -------------------- */
.sg-bk-quickrow {
  display: flex;
  align-items: center;
  gap: var(--sg-s-sm);
}
.sg-bk-quickrow__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sg-s-sm);
  flex: 1;
}
.sg-bk-quickchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: 0 var(--sg-s-md);
  border-radius: var(--sg-r-pill);
  border: 1px solid var(--sg-border);
  background: var(--sg-surface);
  color: var(--sg-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sg-bk-quickchip.is-active {
  background: var(--sg-primary);
  border-color: var(--sg-primary);
  color: var(--sg-on-primary);
}

/* ---------- slot rows (Availability) -------------------------------------- */
.sg-bk-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: var(--sg-s-md);
  border: 1px solid var(--sg-card-border);
  border-radius: var(--sg-r-md);
  background: var(--sg-surface);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sg-bk-slot:disabled { cursor: default; }
.sg-bk-slot--full { opacity: 0.6; }
.sg-bk-slot__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sg-s-sm);
}
.sg-bk-slot__time { font-size: 16px; font-weight: 600; }
.sg-bk-slot__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sg-s-md);
  font-size: 12px;
  color: var(--sg-muted);
}
.sg-bk-slot__closed { font-size: 12px; color: var(--sg-danger); }

/* ---------- booking confirmation ------------------------------------------ */
.sg-bk-confirm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sg-s-sm);
  padding: var(--sg-s-xl) var(--sg-s-lg);
  text-align: center;
}
.sg-bk-confirm__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--sg-success-container);
  color: var(--sg-on-success-container);
}

/* ---------- status history timeline (BookingDetail) ------------------------ */
.sg-bk-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--sg-s-md);
}
.sg-bk-timeline__row {
  padding-left: var(--sg-s-md);
  border-left: 2px solid var(--sg-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ---------- action buttons row (BookingDetail) ----------------------------- */
.sg-bk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sg-s-sm);
}
.sg-bk-actions .sg-btn { flex: 1 1 auto; min-width: 120px; }

/* ==========================================================================
   Faster booking capture - DESIGN-2 §5.D
   ========================================================================== */

/* `Same as my last booking` - a full-width tappable card, >= 64 px. */
.sg-bk-repeat {
  display: flex;
  align-items: center;
  gap: var(--sg-s-md);
  width: 100%;
  min-height: 64px;
  padding: var(--sg-s-md) var(--sg-s-lg);
  border-radius: var(--sg-r-md);
  border: 1px solid var(--sg-border);
  background: var(--sg-surface-variant);
  color: var(--sg-text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sg-bk-repeat:active { background: var(--sg-border); }
.sg-bk-repeat__icon { flex: 0 0 auto; color: var(--sg-primary); display: flex; }
.sg-bk-repeat__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sg-bk-repeat__title { font-size: 15px; font-weight: 700; }
.sg-bk-repeat__sub {
  font-size: 13px;
  color: var(--sg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The `Pre-filled` marker sits on the field's label line and clears the
   moment that field is edited (§5.D.4). */
.sg-prefill-wrap { position: relative; }
.sg-prefill-wrap > .sg-prefilled { position: absolute; top: 0; right: 0; }

/* One-line explanation under Save/Save as draft (parity with Android). */
.sg-bk-draft-helper { text-align: center; margin-top: -4px; }

/* ---------- field-ranger layout (2026-10-04 UX review) -------------------- */
.sg-bk-card__time { font-size: 18px; font-weight: 700; line-height: 24px; }
.sg-bk-card__ref { font-size: 12px; font-weight: 600; color: var(--sg-muted); }
.sg-bk-summary {
  width: 100%; min-height: 48px; padding: 0 var(--sg-s-md);
  border: 1px solid var(--sg-card-border); border-radius: var(--sg-r-md);
  background: var(--sg-surface); color: var(--sg-text);
  font-size: 16px; font-weight: 600; text-align: left; cursor: pointer;
}
.sg-bk-actionrow { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sg-s-sm); }
.sg-bk-guiderow { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-size: 15px; }
.sg-bk-addnotes { display: flex; flex-wrap: wrap; gap: var(--sg-s-sm); }
.sg-bk-hero__when { font-size: 22px; font-weight: 700; line-height: 28px; }
.sg-bk-hero__exp { font-size: 17px; font-weight: 600; }
.sg-bk-hero__line { font-size: 16px; color: var(--sg-text); }
.sg-bk-call { margin-top: var(--sg-s-md); min-height: 52px; font-size: 16px; text-decoration: none; }
.sg-bk-historytoggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  min-height: 48px; padding: 0 var(--sg-s-md);
  border: 1px solid var(--sg-card-border); border-radius: var(--sg-r-md);
  background: var(--sg-surface); color: var(--sg-text); font-size: 15px; font-weight: 600; cursor: pointer;
}

/* Availability: the seats left are the headline, the card is tinted by how full it is. */
.sg-bk-slot__left { font-size: 20px; font-weight: 700; line-height: 24px; }
.sg-bk-slot--GOOD { border-left: 6px solid var(--sg-success); }
.sg-bk-slot--LIMITED { border-left: 6px solid var(--sg-warning); }
.sg-bk-slot--FULL, .sg-bk-slot--CLOSED { border-left: 6px solid var(--sg-danger); }
