/* Podhaus Booking Manager — Booking Form & Account Styles */

[x-cloak] { display: none !important; }

:root {
  --pbm-primary:    #2563eb;
  --pbm-primary-h:  #1d4ed8;
  --pbm-success:    #16a34a;
  --pbm-danger:     #dc2626;
  --pbm-warning:    #d97706;
  --pbm-gray-50:    #f8fafc;
  --pbm-gray-100:   #f1f5f9;
  --pbm-gray-200:   #e2e8f0;
  --pbm-gray-400:   #94a3b8;
  --pbm-gray-600:   #475569;
  --pbm-gray-800:   #1e293b;
  --pbm-radius:     10px;
  --pbm-shadow:     0 4px 24px rgba(0,0,0,.10);
}

.pbm-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--pbm-gray-800);
  max-width: 680px;
  margin: 0 auto;
}

/* ── Progress bar ── */
.pbm-steps {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-radius: var(--pbm-radius);
  overflow: hidden;
  background: var(--pbm-gray-200);
}
.pbm-step {
  flex: 1;
  padding: 10px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--pbm-gray-400);
  letter-spacing: .03em;
  transition: background .2s, color .2s;
}
.pbm-step.active  { background: var(--pbm-primary); color: #fff; }
.pbm-step.done    { background: var(--pbm-success);  color: #fff; }

/* ── Card ── */
.pbm-card {
  background: #fff;
  border-radius: var(--pbm-radius);
  box-shadow: var(--pbm-shadow);
  padding: 32px;
}
.pbm-card h2 {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 700;
}

/* ── Forms ── */
.pbm-field { margin-bottom: 16px; }
.pbm-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--pbm-gray-600);
  margin-bottom: 5px;
}
.pbm-field input,
.pbm-field select,
.pbm-field textarea,
.pbm-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--pbm-gray-200);
  border-radius: 7px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
  background: #fff;
  color: var(--pbm-gray-900, #0f172a);
  font-family: inherit;
}
.pbm-field input:focus,
.pbm-field select:focus,
.pbm-field textarea:focus,
.pbm-input:focus {
  border-color: var(--pbm-primary);
}
.pbm-row { display: flex; gap: 12px; }
.pbm-row .pbm-field { flex: 1; }

/* ── Buttons ── */
.pbm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, opacity .15s;
}
.pbm-btn-primary  { background: var(--pbm-primary); color: #fff; }
.pbm-btn-primary:hover  { background: var(--pbm-primary-h); }
.pbm-btn-outline  { background: transparent; border: 1.5px solid var(--pbm-gray-200); color: var(--pbm-gray-600); }
.pbm-btn-outline:hover  { border-color: var(--pbm-primary); color: var(--pbm-primary); }
.pbm-btn-danger   { background: var(--pbm-danger); color: #fff; }
.pbm-btn:disabled { opacity: .5; cursor: not-allowed; }
.pbm-btn-full     { width: 100%; }
.pbm-btn-sm       { padding: 7px 16px; font-size: 13px; }

/* ── Alert ── */
.pbm-alert {
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 14px;
  margin-bottom: 14px;
}
.pbm-alert-error   { background: #fef2f2; color: var(--pbm-danger);  border-left: 3px solid var(--pbm-danger); }
.pbm-alert-success { background: #f0fdf4; color: var(--pbm-success); border-left: 3px solid var(--pbm-success); }
.pbm-alert-info    { background: #eff6ff; color: var(--pbm-primary); border-left: 3px solid var(--pbm-primary); }

/* ── Auth toggle ── */
.pbm-auth-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--pbm-gray-600);
}
.pbm-auth-toggle a:not(.pbm-btn) {
  color: var(--pbm-primary);
  cursor: pointer;
  text-decoration: underline;
}
.pbm-auth-toggle a.pbm-btn { text-decoration: none; }

/* ── Calendar ── */
.pbm-calendar { user-select: none; }
.pbm-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pbm-cal-header h3 { margin: 0; font-size: 16px; }
.pbm-cal-nav {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--pbm-primary);
  padding: 2px 8px;
  border-radius: 5px;
}
.pbm-cal-nav:hover { background: var(--pbm-gray-100); }
.pbm-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.pbm-cal-day-name {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--pbm-gray-400);
  padding: 4px 0;
}
.pbm-cal-day {
  text-align: center;
  padding: 7px 3px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background .15s;
}
.pbm-cal-day:hover:not(.disabled):not(.other-month):not(.selected) { background: var(--pbm-gray-100); }
.pbm-cal-day.selected { background: var(--pbm-primary); color: #fff; }
.pbm-cal-day.today    { font-weight: 700; text-decoration: underline; }
.pbm-cal-day.disabled { color: var(--pbm-gray-400); cursor: default; }
.pbm-cal-day.other-month { color: var(--pbm-gray-200); cursor: default; }

/* ── Time slots ── */
.pbm-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.pbm-slot {
  text-align: center;
  padding: 9px 5px;
  border-radius: 7px;
  border: 1.5px solid var(--pbm-gray-200);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all .15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pbm-slot:hover:not(.unavailable):not(.selected) { border-color: var(--pbm-primary); color: var(--pbm-primary); }
.pbm-slot.selected  { background: var(--pbm-primary); color: #fff; -webkit-text-fill-color: #fff; border-color: var(--pbm-primary); }
.pbm-slot.unavailable { background: var(--pbm-gray-100); color: var(--pbm-gray-400); cursor: not-allowed; text-decoration: line-through; }

/* ── Duration selector ── */
.pbm-duration-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.pbm-duration-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--pbm-gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.pbm-duration-stepper button {
  background: var(--pbm-gray-100);
  border: none;
  width: 36px;
  height: 36px;
  font-size: 20px;
  cursor: pointer;
  color: var(--pbm-primary);
}
.pbm-duration-stepper button:hover { background: var(--pbm-gray-200); }
.pbm-duration-stepper span {
  padding: 0 16px;
  font-size: 16px;
  font-weight: 700;
}

/* ── Price badge ── */
.pbm-price-badge {
  background: var(--pbm-gray-50);
  border: 1.5px solid var(--pbm-gray-200);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 16px;
}
.pbm-price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 2px 0;
}
.pbm-price-line.total {
  font-size: 17px;
  font-weight: 700;
  border-top: 1px solid var(--pbm-gray-200);
  margin-top: 8px;
  padding-top: 8px;
}
.pbm-price-line.discount { color: var(--pbm-success); }

/* ── Coupon ── */
.pbm-coupon-row {
  display: flex;
  gap: 8px;
}
.pbm-coupon-row .pbm-field { flex: 1; margin-bottom: 0; }
.pbm-coupon-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  color: var(--pbm-success);
  border: 1px solid var(--pbm-success);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
}

/* ── Review ── */
.pbm-review-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.pbm-review-table td { padding: 8px 0; border-bottom: 1px solid var(--pbm-gray-100); font-size: 14px; }
.pbm-review-table td:last-child { text-align: right; font-weight: 600; }

/* ── Navigation footer ── */
.pbm-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 10px;
}

/* ── Loading spinner ── */
.pbm-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pbm-spin .7s linear infinite;
  vertical-align: middle;
}
.pbm-spinner-dark {
  border-color: rgba(0,0,0,.15);
  border-top-color: var(--pbm-primary);
}
@keyframes pbm-spin { to { transform: rotate(360deg); } }

/* ── Skeleton loader ── */
.pbm-skeleton {
  background: linear-gradient(90deg, var(--pbm-gray-100) 25%, var(--pbm-gray-200) 50%, var(--pbm-gray-100) 75%);
  background-size: 200% 100%;
  animation: pbm-shimmer 1.4s infinite;
  border-radius: 6px;
  height: 36px;
  margin-bottom: 6px;
}
@keyframes pbm-shimmer { 0%{background-position:200%}100%{background-position:-200%} }

/* ── Account page ── */
.pbm-account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.pbm-account-header h2 { margin: 0; }
.pbm-bookings-list { display: flex; flex-direction: column; gap: 12px; }
.pbm-booking-card {
  background: #fff;
  border-radius: var(--pbm-radius);
  box-shadow: var(--pbm-shadow);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.pbm-booking-info { flex: 1; }
.pbm-booking-date { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.pbm-booking-meta { font-size: 13px; color: var(--pbm-gray-600); }
.pbm-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}
.pbm-status-confirmed       { background: #dcfce7; color: var(--pbm-success); }
.pbm-status-pending_payment { background: #fef9c3; color: var(--pbm-warning); }
.pbm-status-cancelled       { background: var(--pbm-gray-100); color: var(--pbm-gray-400); }
.pbm-status-failed          { background: #fee2e2; color: var(--pbm-danger); }

/* ── Empty state ── */
.pbm-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--pbm-gray-400);
}
.pbm-empty-icon { font-size: 40px; margin-bottom: 10px; }

/* ── Reschedule panel ── */
.pbm-rs-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pbm-rs-panel-inner {
  background: #fff;
  border-radius: var(--pbm-radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  padding: 28px 32px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Tab bar (account page) ── */
.pbm-tab,
.pbm-tab-active {
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--pbm-gray-600);
  transition: color .15s, border-bottom-color .15s;
}
.pbm-tab:hover { color: var(--pbm-gray-800); }
.pbm-tab-active {
  color: var(--pbm-gray-800);
  border-bottom-color: var(--pbm-gray-800);
  font-weight: 600;
}

/* ── Reschedule calendar (account page) ── */
/* Navigation row: prev / month label / next */
.pbm-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pbm-calendar-nav button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--pbm-primary);
  padding: 2px 8px;
  border-radius: 5px;
}
.pbm-calendar-nav button:hover { background: var(--pbm-gray-100); }

/* 7-column day grid */
.pbm-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

/* Day-name header cells inside the account reschedule grid (Su Mo Tu …) */
/* Scoped to .pbm-calendar-grid to avoid conflicting with the booking form's
   .pbm-cal-header which is a flex nav row in a different context. */
.pbm-calendar-grid .pbm-cal-header {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--pbm-gray-400);
  padding: 4px 0;
  display: block;
  margin-bottom: 0;
}

/* Day cells: reset <button> and apply base style */
.pbm-cal-day {
  appearance: none;
  background: none;
  border: none;
  text-align: center;
  padding: 7px 3px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: background .15s;
}
.pbm-cal-day:hover:not(.pbm-cal-disabled):not(.pbm-cal-other) { background: var(--pbm-gray-100); }
.pbm-cal-day.pbm-cal-selected,
.pbm-cal-day.selected          { background: var(--pbm-primary); color: #fff; }
.pbm-cal-day.pbm-cal-today,
.pbm-cal-day.today             { font-weight: 700; text-decoration: underline; }
.pbm-cal-day.pbm-cal-disabled,
.pbm-cal-day.disabled          { color: var(--pbm-gray-400); cursor: default; }
.pbm-cal-day.pbm-cal-other,
.pbm-cal-day.other-month       { color: var(--pbm-gray-300, #cbd5e1); cursor: default; }

/* ── Reschedule time-slot buttons (account page) ── */
/* pbm-slot-btn mirrors pbm-slot from the booking form */
.pbm-slot-btn {
  text-align: center;
  padding: 9px 5px;
  border-radius: 7px;
  border: 1.5px solid var(--pbm-gray-200);
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition: all .15s;
  width: 100%;
}
.pbm-slot-btn:hover:not(.pbm-slot-unavailable) {
  border-color: var(--pbm-primary);
  color: var(--pbm-primary);
}
.pbm-slot-btn.pbm-slot-selected  {
  background: var(--pbm-primary);
  color: #fff;
  border-color: var(--pbm-primary);
}
.pbm-slot-btn.pbm-slot-unavailable {
  background: var(--pbm-gray-100);
  color: var(--pbm-gray-400);
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ── Responsive ── */
@media (max-width: 540px) {
  .pbm-card { padding: 20px 16px; }
  .pbm-row  { flex-direction: column; gap: 0; }
  .pbm-step { font-size: 10px; padding: 8px 3px; }
  .pbm-booking-card { flex-direction: column; align-items: flex-start; }
  .pbm-rs-panel-inner { padding: 20px 16px; }
  .pbm-tab, .pbm-tab-active { padding: 8px 10px; font-size: 14px; }
}
