/* ==========================================================================
   Therapist Booking – Front-end Styles
   ========================================================================== */

/* ---------- Reset & Variables ------------------------------------------- */
.tb-calendar-wrap *,
.tb-modal * {
  box-sizing: border-box;
}

:root {
  --tb-primary: #4a90d9;
  --tb-primary-dark: #357abd;
  --tb-secondary: #27ae60;
  --tb-danger: #e74c3c;
  --tb-warning: #f39c12;
  --tb-light: #f5f7fa;
  --tb-border: #dde2ea;
  --tb-text: #2d3748;
  --tb-muted: #718096;
  --tb-radius: 3px;
  --tb-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

/* ---------- Therapist List ---------------------------------------------- */
.tb-therapist-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 8px 0;
}

.tb-therapist-card {
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}

.tb-therapist-card:hover {
  box-shadow: var(--tb-shadow);
}

.tb-therapist-photo img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.tb-therapist-info {
  padding: 18px 20px 22px;
}

.tb-therapist-name {
  margin: 0 0 4px;
  font-size: 1.15rem;
  color: var(--tb-text);
}

.tb-therapist-title {
  margin: 0 0 8px;
  color: var(--tb-muted);
  font-size: 0.9rem;
}

.tb-therapist-services {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--tb-primary);
}

/* ---------- Buttons ----------------------------------------------------- */
.tb-btn-book,
.tb-btn-submit {
  display: inline-block;
  padding: 10px 22px;
  background: var(--tb-primary);
  color: #fff;
  border: none;
  border-radius: var(--tb-radius);
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
  transition:
    background 0.2s,
    transform 0.1s;
  font-weight: 600;
}

.tb-btn-book:hover,
.tb-btn-submit:hover {
  background: #1d4f6e;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.tb-btn-submit {
  width: 100%;
  padding: 13px;
  font-size: 1rem;
  margin-top: 8px;
}

.tb-btn-nav {
  background: none;
  border: 1px solid var(--tb-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--tb-text);
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tb-btn-nav:hover {
  background: var(--tb-light);
}

/* ---------- Service Selector -------------------------------------------- */
.tb-calendar-wrap {
  max-width: 800px;
  margin: 0 auto;
  font-family: inherit;
  color: var(--tb-text);
}

/* ---------- Service card click-to-select -------------------------------- */
.tbc-service-card.tb-service-trigger {
  cursor: pointer;
  user-select: none;
}

.tbc-service-card.tb-service-trigger:focus-visible {
  outline: 3px solid var(--tb-primary);
  outline-offset: 2px;
}

.tbc-service-card.tb-service-active {
  box-shadow: 0 0 0 3px var(--tb-primary) !important;
  transform: translateY(-2px);
}

/* ---------- Calendar Navigation ----------------------------------------- */
.tb-calendar-container {
  background: #fff;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.tb-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--tb-primary);
  color: #fff;
}

.tb-calendar-nav .tb-btn-nav {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.tb-calendar-nav .tb-btn-nav:hover {
  background: rgba(255, 255, 255, 0.15);
}

.tb-month-label {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ---------- Calendar Grid ----------------------------------------------- */
.tb-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.tb-cal-header {
  padding: 8px 4px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tb-muted);
  background: var(--tb-light);
  border-bottom: 1px solid var(--tb-border);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tb-cal-day {
  min-height: 64px;
  padding: 6px 8px;
  border: 1px solid var(--tb-border);
  border-top: none;
  border-left: none;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.tb-cal-day:nth-child(7n) {
  border-right: none;
}

.tb-cal-day:hover:not(.tb-day-empty):not(.tb-day-past) {
  background: #eaf4fb;
}

.tb-cal-day.tb-day-empty,
.tb-cal-day.tb-day-past {
  cursor: default;
  background: #fafafa;
  color: #bbb;
}

.tb-cal-day.tb-day-selected {
  background: #dbeef8;
  border-color: var(--tb-primary);
  z-index: 1;
}

.tb-cal-day.tb-day-today .tb-day-num {
  background: var(--tb-primary);
  color: #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tb-day-num {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 4px;
  display: inline-block;
}

.tb-day-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

.tb-day-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  opacity: 0.85;
}

/* ---------- Slot List --------------------------------------------------- */
.tb-slot-list {
  background: #fff;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  padding: 20px;
  margin-bottom: 24px;
}

.tb-slot-date-label {
  margin: 0 0 16px;
  font-size: 1.05rem;
  color: var(--tb-primary);
}

.tb-slots-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tb-slot-btn {
  padding: 9px 16px;
  border-radius: var(--tb-radius);
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 80px;
}

.tb-slot-btn.available {
  background: var(--tb-secondary);
  color: #fff;
  border-color: var(--tb-secondary);
}

.tb-slot-btn.available:hover {
  background: #1e8449;
  border-color: #1e8449;
}

.tb-slot-btn.booked,
.tb-slot-btn.pending {
  background: #fdf2f2;
  color: var(--tb-danger);
  border-color: #f5c6cb;
  cursor: not-allowed;
}

.tb-slot-status {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tb-no-slots {
  color: var(--tb-muted);
  font-style: italic;
}

/* ---------- Modal ------------------------------------------------------- */
.tb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: tbFadeIn 0.2s ease;
}

@keyframes tbFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.tb-modal {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: var(--tb-shadow);
  max-height: 90vh;
  overflow-y: auto;
}

.tb-modal h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  color: var(--tb-text);
}

.tb-modal-slot-summary {
  background: var(--tb-light);
  border-radius: var(--tb-radius);
  padding: 12px 16px;
  margin-bottom: 22px;
  font-size: 0.92rem;
  color: var(--tb-primary);
  font-weight: 600;
}

.tb-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--tb-muted);
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
}

.tb-modal-close:hover {
  color: var(--tb-danger);
}

/* ---------- Form -------------------------------------------------------- */
.tb-field {
  margin-bottom: 16px;
}

.tb-field label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tb-text);
}

.tb-field input,
.tb-field textarea {
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  padding: 10px 12px;
  font-size: 0.95rem;
  color: var(--tb-text);
  width: 100%;
  transition: border-color 0.15s;
  font-family: inherit;
}

.tb-field input:focus,
.tb-field textarea:focus {
  outline: none;
  border-color: var(--tb-primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.12);
}

.tb-form-feedback {
  min-height: 20px;
  font-size: 0.9rem;
  padding: 0;
  margin-bottom: 8px;
  border-radius: var(--tb-radius);
}

.tb-form-feedback.error {
  background: #fdf2f2;
  color: var(--tb-danger);
  padding: 10px 14px;
  border: 1px solid #f5c6cb;
}

.tb-form-feedback.success {
  background: #f0fdf4;
  color: #166534;
  padding: 10px 14px;
  border: 1px solid #bbf7d0;
}

/* ---------- Error text -------------------------------------------------- */
.tb-error {
  color: var(--tb-danger);
  font-style: italic;
}

/* ---------- Loader spinner ---------------------------------------------- */
.tb-loading {
  text-align: center;
  padding: 24px;
  color: var(--tb-muted);
}

.tb-loading::after {
  content: '';
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid var(--tb-border);
  border-top-color: var(--tb-primary);
  border-radius: 50%;
  animation: tbSpin 0.7s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes tbSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Booking Intro & Step Indicator ----------------------------- */
.tb-booking-intro {
  margin-bottom: 40px;
}

.tb-booking-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 14px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.tb-booking-step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
}

.tb-booking-step--active {
  opacity: 1;
}

.tb-booking-step--done {
  opacity: 0.75;
}

.tb-booking-step--done .tb-step-number {
  background: #27ae60;
  color: #fff;
}

.tb-booking-step--done .tb-step-label {
  color: #475569;
  text-decoration: line-through;
  text-decoration-color: #94a3b8;
}

a.tb-booking-step--link {
  text-decoration: none;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s;
}

a.tb-booking-step--link:hover {
  opacity: 1;
}

a.tb-booking-step--link:hover .tb-step-label {
  color: #1a2e44;
  text-decoration: underline;
  text-decoration-color: #27ae60;
}

.tb-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}

.tb-booking-step--active .tb-step-number {
  background: #4a90d9;
  color: #fff;
}

.tb-step-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.tb-booking-step--active .tb-step-label {
  color: #1a2e44;
}

.tb-step-arrow {
  color: #cbd5e1;
  font-size: 1rem;
  flex-shrink: 0;
}

.tb-booking-intro-text {
  padding: 0 4px;
}

.tb-booking-intro-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a2e44;
  margin: 0 0 10px;
}

.tb-booking-intro-desc {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.65;
  margin: 0 0 16px;
  max-width: 680px;
}

.tb-booking-intro-hints {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tb-booking-intro-hints li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #475569;
}

.tb-booking-intro-hints svg {
  color: #27ae60;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .tb-booking-steps {
    gap: 6px;
    padding: 12px 14px;
  }
  .tb-step-arrow {
    display: none;
  }
  .tb-booking-step {
    gap: 5px;
  }
}

/* ---------- Service context floating bar -------------------------------- */
.tbc-service-context-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 28px;
  background: #fff;
  box-shadow: 0 -2px 18px rgba(0, 0, 0, 0.13);
  border-top: 3px solid var(--ctx-color, #4a90d9);
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.tbc-service-context-bar--hidden {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.tbc-scb-swatch {
  width: 8px;
  align-self: stretch;
  border-radius: 4px;
  flex-shrink: 0;
}

.tbc-scb-info {
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
}

.tbc-scb-label {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
}

.tbc-scb-name {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.tbc-scb-pill {
  font-size: 0.72rem;
  color: #475569;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
}

.tbc-scb-btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: 6px;
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.tbc-scb-btn:hover {
  opacity: 0.85;
}

.tbc-scb-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.tbc-scb-close:hover {
  color: #475569;
}

@media (max-width: 600px) {
  .tbc-service-context-bar {
    flex-wrap: wrap;
    padding: 10px 16px 12px;
    gap: 6px;
  }
  .tbc-scb-label {
    display: none;
  }
  .tbc-scb-btn {
    width: 100%;
    text-align: center;
    order: 10;
    padding: 10px;
  }
}

/* ---------- Booking progress bar ---------------------------------------- */

/* Standalone: shown directly on taxonomy / therapist pages */
.tbc-booking-progress {
  max-width: 1140px;
  margin: 0 auto 32px;
  padding: 0 24px;
}

/* Inline: embedded inside the [all_services] shortcode content wrap */
.tbc-booking-progress--inline {
  max-width: none;
  margin: 0 0 28px;
  padding: 0;
}

.tbc-booking-progress .tb-booking-steps,
.tbc-booking-progress--inline .tb-booking-steps {
  margin-bottom: 0;
}

/* ---------- All Services Grid ------------------------------------------ */
.tb-all-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 8px 0;
}

.tb-service-overview-card {
  background: #fff;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  overflow: hidden;
  transition:
    box-shadow 0.2s,
    transform 0.15s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

a.tb-service-overview-card:hover,
a.tb-service-overview-card:focus {
  box-shadow: 0 8px 31px rgba(0, 0, 0, 0.11);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.tb-soc-color-bar {
  height: 5px;
  width: 100%;
  flex-shrink: 0;
}

.tb-soc-body {
  padding: 21px 21px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tb-soc-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.tb-soc-desc {
  font-size: 0.88rem;
  color: var(--tb-muted);
  line-height: 1.6;
  margin: 0 0 16px;
  flex: 1;
}

.tb-soc-meta {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tb-soc-meta li {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: #4a5568;
  font-weight: 600;
}

.tb-soc-link {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--tb-primary);
  border-radius: var(--tb-radius);
  padding: 7px 14px;
  transition: all 0.15s;
  align-self: flex-start;
  color: var(--tb-primary);
}

.tb-soc-link:hover {
  color: #fff;
  text-decoration: none;
}

/* ---------- Responsive ------------------------------------------------- */
@media (max-width: 600px) {
  .tb-cal-day {
    min-height: 46px;
    padding: 4px 4px;
  }

  .tb-day-num {
    font-size: 0.75rem;
  }

  .tb-cal-header {
    font-size: 0.65rem;
    padding: 6px 2px;
  }

  .tb-slot-btn {
    min-width: 68px;
    font-size: 0.82rem;
    padding: 7px 10px;
  }

  .tb-therapist-list {
    grid-template-columns: 1fr;
  }
}
