/* ============================================================
   BOOKERAI — BOOKING PAGE STYLES
   Clean, modern layout that works beautifully on mobile + desktop.
   ============================================================ */

:root {
  --bk-blue: #0ea5e9;
  --bk-blue-dark: #0284c7;
  --bk-teal: #14b8a6;
  --bk-text: #0f172a;
  --bk-muted: #64748b;
  --bk-bg: #f0faff;
  --bk-card: #ffffff;
  --bk-border: rgba(14, 165, 233, 0.18);
  --bk-shadow: 0 4px 20px rgba(14, 165, 233, 0.1);
  --bk-shadow-hover: 0 8px 28px rgba(14, 165, 233, 0.18);
  --bk-radius: 1rem;
}

/* Dark mode overrides for booking page variables */
[data-theme="dark"] {
  --bk-text: #f8fafc;
  --bk-muted: #94a3b8;
  --bk-bg: #0b1121;
  --bk-card: #1e293b;
  --bk-border: rgba(255, 255, 255, 0.1);
  --bk-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --bk-shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.4);
}

/* ==============================
   PAGE WRAPPER
============================== */
.book-wrap {
  max-width: 960px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ==============================
   BARBER HEADER
============================== */
.book-header {
  background: var(--bk-card);
  border-radius: var(--bk-radius);
  padding: 1.1rem 1.5rem;
  box-shadow: var(--bk-shadow);
  border: 1px solid var(--bk-border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bh-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.bh-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
  border: 2px solid rgba(14, 165, 233, 0.3);
}

.bh-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bh-avatar-initials {
  background: linear-gradient(135deg, var(--bk-blue), var(--bk-teal));
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bh-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bh-name {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--bk-text);
  line-height: 1.2;
}

.bh-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--bk-muted);
  flex-wrap: wrap;
}

.bh-badge {
  background: rgba(14, 165, 233, 0.1);
  color: var(--bk-blue);
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.bh-sep { color: var(--bk-muted); opacity: 0.5; }

.rating-display {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.star { color: #f59e0b; }

/* ==============================
   TWO-COLUMN LAYOUT
============================== */
.book-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 800px) {
  .book-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .book-main {
    flex: 1 1 0;
    min-width: 0;
  }

  .book-aside {
    width: 260px;
    flex-shrink: 0;
  }
}

.book-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ==============================
   STEP CARDS
============================== */
.step-card {
  background: var(--bk-card);
  border-radius: var(--bk-radius);
  padding: 1.5rem;
  box-shadow: var(--bk-shadow);
  border: 1px solid var(--bk-border);
}

.step-head {
  margin-bottom: 1rem;
}

.step-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.step-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bk-text);
  margin-bottom: 0.2rem;
}

.step-sub {
  font-size: 0.875rem;
  color: var(--bk-muted);
  margin: 0;
}

.mt-3 { margin-top: 0.75rem; }

/* ==============================
   BACK BUTTON
============================== */
.btn-back {
  background: transparent;
  border: 1.5px solid var(--bk-border);
  border-radius: 0.6rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bk-blue);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-back:hover {
  background: rgba(14, 165, 233, 0.07);
  border-color: var(--bk-blue);
}

/* ==============================
   DATE CHOOSER
============================== */
.date-chooser {
  margin-top: 0.75rem;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

@media (min-width: 480px) {
  .day-strip {
    grid-template-columns: repeat(6, 1fr);
  }
}

.day-pill {
  background: var(--bk-card);
  border: 1.5px solid var(--bk-border);
  border-radius: 0.75rem;
  padding: 0.55rem 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bk-text);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.day-pill:hover {
  border-color: var(--bk-blue);
  color: var(--bk-blue);
  box-shadow: 0 3px 10px rgba(14, 165, 233, 0.15);
}

.day-pill.selected,
.day-pill.active {
  background: linear-gradient(135deg, var(--bk-blue), var(--bk-teal));
  color: #fff;
  border-color: transparent;
}

.day-pill.outline {
  border-style: dashed;
  color: var(--bk-muted);
}

/* Calendar styles (injected by JS) */
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--bk-text);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-cell {
  padding: 7px 4px;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
  color: var(--bk-text);
}

.cal-cell:hover:not(.disabled) {
  background: rgba(14, 165, 233, 0.12);
  color: var(--bk-blue);
}

.cal-cell.disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.cal-cell.selected {
  background: var(--bk-blue);
  color: #fff;
  font-weight: 700;
  border-radius: 0.5rem;
}

/* BUG-6 fix: .today used a bold outline identical to .selected, so users
   couldn't tell whether they had actually selected a day. Replace with a
   small dot below the number so "today" is recognisable but clearly distinct
   from the solid-fill "selected" state. When a day is both today AND selected
   the blue fill wins and the dot is hidden (white-on-blue isn't readable). */
.cal-cell.today {
  font-weight: 600;
  position: relative;
}

.cal-cell.today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bk-blue);
}

/* When today is also selected, hide the dot (blue fill already identifies it) */
.cal-cell.today.selected::after {
  display: none;
}

.cal-weekday {
  font-size: 0.75rem;
  color: var(--bk-muted);
  font-weight: 600;
  padding-bottom: 4px;
}

.cal-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--bk-blue);
  padding: 0 0.5rem;
  line-height: 1;
}

/* ==============================
   TIME SLOT GRID (legacy — kept for non-v3 contexts)
============================== */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 0.75rem;
}

@media (min-width: 480px) {
  .slot-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Empty state (legacy) */
.slot-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--bk-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ==============================
   INFO FIELDS
============================== */
.info-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 540px) {
  .info-fields {
    flex-direction: row;
  }

  .field-group {
    flex: 1;
  }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bk-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-input {
  width: 100%;
  border: 1.5px solid var(--bk-border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--bk-text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.field-input:focus {
  border-color: var(--bk-blue);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
  outline: none;
}

.field-input::placeholder {
  color: #94a3b8;
}

/* ==============================
   SUMMARY CARD
============================== */
.summary-card {
  background: linear-gradient(135deg, #f0faff 0%, #e8f8ff 100%);
  border-color: rgba(14, 165, 233, 0.2);
}

.sum-table {
  margin: 0.75rem 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(14, 165, 233, 0.12);
  font-size: 0.9rem;
}

.sum-row:last-child {
  border-bottom: none;
}

.sum-row span {
  color: var(--bk-muted);
}

.sum-row strong {
  color: var(--bk-text);
  font-weight: 600;
}

/* ==============================
   BOOK BUTTON
============================== */
.book-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--bk-blue) 0%, var(--bk-blue-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 0.875rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.book-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(14, 165, 233, 0.5);
}

.book-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.book-btn:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

.book-hint {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--bk-muted);
}

/* ==============================
   SIDEBAR CARDS
============================== */
.book-aside {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.aside-card {
  background: var(--bk-card);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  padding: 1.25rem;
  box-shadow: var(--bk-shadow);
}

.aside-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bk-blue);
  margin: 0 0 0.75rem;
}

.tip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tip-list li {
  font-size: 0.875rem;
  color: var(--bk-muted);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.5;
}

.tip-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--bk-teal);
  font-weight: 700;
  font-size: 0.8rem;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 220px;
  overflow-y: auto;
}

/* ==============================
   PORTFOLIO GALLERY (sidebar)
============================== */
.gallery-grid-small {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.gallery-thumb {
  aspect-ratio: 1;
  border-radius: 0.6rem;
  overflow: hidden;
  background: #e2e8f0;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-thumb img:hover {
  transform: scale(1.06);
}

/* ==============================
   UTILITY
============================== */
.hidden {
  display: none !important;
}

/* Loading spinner keyframe */
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.step-card {
  animation: fadeIn 0.3s ease both;
}

/* ==============================
   MOBILE OVERRIDES
============================== */
@media (max-width: 480px) {
  .book-wrap {
    margin: 0.75rem auto 2rem;
    padding: 0 0.75rem;
  }

  .step-card {
    padding: 1.1rem 1rem;
  }

  .book-header {
    padding: 0.9rem 1rem;
  }

  .slot-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
}
