/* ========================================
   SCHEDULER STYLES - Tough Oak Brand
   Uses variables from style.css
   ======================================== */

/* Scheduler-specific CSS variables (inheriting from style.css) */
#scheduler-screen {
  --green: #014421;
  --cream: #FFF8E1;
  --cream-2: #F3E6C8;
  --cream-3: #EFE7D0;
  --cream-darker: #E8DEC0;
  --copper: #B87333;
  --copper-dark: #8d5a28;
  --ink: #0e0e0e;
  --ink-2: #222;
  --muted: #6b6b6b;
  --charcoal: #3a3a3a;
  --shadow: 0 6px 20px rgba(0,0,0,.08);
  --R: 14px;
}

/* Scope box-sizing to scheduler only */
#scheduler-screen * {
  box-sizing: border-box;
}

/* Main scheduler panel - unified cream background */
#scheduler-screen .booking-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px;
  background: var(--cream-2);
  border-radius: var(--R);
  border: 1px solid var(--cream-3);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

#scheduler-screen .booking-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Step headings - centered pill style */
#scheduler-screen .step-heading {
  display: inline-block;
  margin: 0 auto 12px auto;
  padding: 5px 16px;
  border-radius: 999px;
  background: var(--cream-darker);
  color: var(--charcoal);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
}

/* Center the pill within its container */
#scheduler-screen .booking-layout > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Swiper container */
#scheduler-screen .swiper {
  padding: 4px 0 12px 0;
  width: 100%;
  overflow: hidden;
  position: relative;
  /* Enable touch scrolling on mobile */
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

#scheduler-screen .swiper-wrapper {
  align-items: stretch;
  /* Ensure proper touch handling */
  touch-action: manipulation;
}

#scheduler-screen .swiper-slide {
  padding: 0 3px;
  /* Prevent text selection during swipe */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/* Reduce gaps on desktop by increasing side padding */
@media (min-width: 768px) {
  #scheduler-screen .swiper-slide {
    padding: 0 0px;
  }
}

/* ========================================
   DATE CARDS - Three states with clear contrast
   ======================================== */

#scheduler-screen .day-card {
  background: var(--cream-darker);
  border-radius: calc(var(--R) * 0.8);
  border: 1px solid var(--cream-3);
  padding: 10px 8px;
  min-height: 85px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.8rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

#scheduler-screen .day-card__day {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  font-size: 0.75rem;
}

#scheduler-screen .day-card__date {
  font-weight: 600;
  color: var(--ink-2);
  font-size: 0.85rem;
  white-space: nowrap;
}

#scheduler-screen .day-card__status {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
  text-align: center;
}

/* Available state - hover effect */
#scheduler-screen .day-card--available:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  border-color: rgba(1, 68, 33, 0.2);
}

/* Selected state - brand green */
#scheduler-screen .day-card--selected {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 4px 14px rgba(1, 68, 33, 0.25);
  transform: translateY(-2px);
}

#scheduler-screen .day-card--selected .day-card__day,
#scheduler-screen .day-card--selected .day-card__date,
#scheduler-screen .day-card--selected .day-card__status {
  color: var(--cream);
}

/* Booked state - muted grey with proper contrast */
#scheduler-screen .day-card--booked {
  background: #d8d8d8;
  border-style: dashed;
  border-color: #b0b0b0;
  color: var(--muted);
  cursor: default;
  box-shadow: none;
}

#scheduler-screen .day-card--booked .day-card__day,
#scheduler-screen .day-card--booked .day-card__date,
#scheduler-screen .day-card--booked .day-card__status {
  color: var(--muted);
}

#scheduler-screen .day-card--booked .day-card__day {
  white-space: nowrap;
}

#scheduler-screen .day-card--booked .day-card__date {
  white-space: nowrap;
}

#scheduler-screen .day-card--booked:hover {
  transform: none;
  box-shadow: none;
}

/* Swiper pagination - centered with limited bullets */
#scheduler-screen .swiper-pagination {
  position: relative !important;
  text-align: center !important;
  margin: 8px auto 0 auto !important;
  padding: 0 !important;
  height: 20px !important;
  display: block !important;
  width: 100% !important;
}

#scheduler-screen .swiper-pagination-bullet {
  background: rgba(1, 68, 33, 0.3) !important;
  opacity: 1 !important;
  margin: 0 4px !important;
  transition: all 0.2s ease !important;
}

#scheduler-screen .swiper-pagination-bullet-active {
  background: var(--green) !important;
  transform: scale(1.2) !important;
}

/* Limit visible bullets to prevent clutter - hide bullets beyond 9 */
#scheduler-screen .swiper-pagination-bullet:nth-child(n+8) {
  display: none !important;
}

/* Swiper navigation arrows - small and subtle */
#scheduler-screen .swiper-button-prev,
#scheduler-screen .swiper-button-next {
  color: var(--green) !important;
  width: 24px !important;
  height: 24px !important;
  background: transparent !important;
  top: auto !important;
  bottom: -32px !important;
  margin-top: 0 !important;
  position: absolute !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

#scheduler-screen .swiper-button-prev {
  left: 0 !important;
}

#scheduler-screen .swiper-button-next {
  right: 0 !important;
}

#scheduler-screen .swiper-button-prev::after,
#scheduler-screen .swiper-button-next::after {
  font-size: 12px !important;
  font-weight: 900 !important;
  color: var(--green) !important;
}

#scheduler-screen .swiper-button-prev.swiper-button-disabled,
#scheduler-screen .swiper-button-next.swiper-button-disabled {
  opacity: 0.35 !important;
  display: block !important;
}

/* ========================================
   TIME SLOTS - Clean cream chips
   ======================================== */

/* Remove white panel - transparent background */
#scheduler-screen .slots-panel {
  background: transparent;
  border: none;
  padding: 0;
  min-height: auto;
  width: 100%;
}

#scheduler-screen .slots-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 640px) {
  #scheduler-screen .slots-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 980px) {
  #scheduler-screen .slots-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Time chip - unselected */
#scheduler-screen .slot-chip {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(1, 68, 33, 0.15);
  padding: 10px 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--cream-3);
  color: var(--ink-2);
  white-space: nowrap;
  text-align: center;
  transition: all 0.12s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

#scheduler-screen .slot-chip:hover {
  background: var(--cream);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,.08);
  border-color: rgba(1, 68, 33, 0.25);
}

/* Time chip - selected */
#scheduler-screen .slot-chip--selected {
  background: var(--green);
  border-color: var(--green);
  color: var(--cream);
  font-weight: 600;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(1, 68, 33, 0.3);
}

#scheduler-screen .slot-chip--selected:hover {
  background: var(--green);
  color: var(--cream);
}

#scheduler-screen .slots-empty {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

/* ========================================
   SUMMARY BAR - Centered pill + button layout
   ======================================== */

#scheduler-screen .summary-bar {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--cream-3);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Summary pill - darker cream background */
#scheduler-screen .summary-pill {
  border-radius: 999px;
  background: rgba(184, 115, 51, 0.15);
  padding: 6px 14px;
  text-align: center;
}

#scheduler-screen .summary-pill span {
  color: var(--charcoal);
  font-weight: 500;
  font-size: 0.88rem;
}

/* Slots left text - pill styled to match step headings */
#scheduler-screen .summary-slots-left {
  margin: 0;
  font-size: 0.88rem;
  color: var(--charcoal);
  font-weight: 500;
  text-align: center;
  border-radius: 999px;
  background: var(--cream-darker);
  padding: 6px 14px;
}

/* Summary button - brand green pill */
#scheduler-screen .summary-bar__cta {
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--green);
  color: var(--cream);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 3px 10px rgba(1, 68, 33, 0.25);
}

#scheduler-screen .summary-bar__cta:hover:not(:disabled) {
  background: #013319;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(1, 68, 33, 0.35);
}

#scheduler-screen .summary-bar__cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

#scheduler-screen .summary-bar__cta:active:not(:disabled) {
  transform: translateY(0);
}

/* ========================================
   RESPONSIVE - Mobile adjustments
   ======================================== */

@media (max-width: 600px) {
  #scheduler-screen .booking-section {
    padding: 18px 16px;
  }

  #scheduler-screen .summary-bar {
    gap: 12px;
  }

  #scheduler-screen .summary-bar__cta {
    padding: 12px 20px;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
  }

  #scheduler-screen .day-card {
    padding: 8px 6px;
    min-height: 80px;
  }
}

/* Extra responsive handling for very small screens */
@media (max-width: 380px) {
  #scheduler-screen .summary-bar__cta {
    padding: 11px 16px;
    font-size: 0.75rem;
  }
}

/* ========================================
   CONFIRMATION SCREEN
   ======================================== */

#scheduler-screen .booking-confirmation {
  max-width: 960px;
  margin: 0 auto;
  padding: 60px 20px;
  background: var(--cream-2);
  border-radius: var(--R);
  border: 1px solid var(--cream-3);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  text-align: center;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#scheduler-screen .confirmation-content {
  max-width: 600px;
  width: 100%;
}

#scheduler-screen .confirmation-label {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 16px 0;
  line-height: 1.3;
  text-align: center;
}

#scheduler-screen .confirmation-datetime {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--green);
  margin: 0 0 32px 0;
  line-height: 1.3;
  text-align: center;
}

#scheduler-screen .confirmation-details {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  text-align: left;
  max-width: 300px;
  width: fit-content;
}

#scheduler-screen .confirmation-details li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.5;
}

#scheduler-screen .confirmation-details li:last-child {
  margin-bottom: 0;
}

#scheduler-screen .confirmation-details .check-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

#scheduler-screen .confirmation-details span {
  flex: 1;
}

/* Intake step */
#scheduler-screen .intake-section {
  background: #fff8e1;
  border: 1px solid #e0d3b5;
  border-radius: 16px;
  padding: 12px 12px 14px 12px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
}

#scheduler-screen .intake-frame {
  background: #fff8e1;
  border-radius: 12px;
  border: 1px solid #e0d3b5;
  overflow: hidden;
}

#scheduler-screen[data-step="intake"] #scheduler-calendar {
  display: none;
}

#scheduler-screen[data-step="calendar"] #scheduler-intake {
  display: none;
}

#scheduler-screen[data-step="confirmation"] #scheduler-intake,
#scheduler-screen[data-step="confirmation"] #scheduler-calendar {
  display: none;
}

@media (max-width: 600px) {
  #scheduler-screen .booking-confirmation {
    padding: 40px 20px;
    min-height: 250px;
  }

  #scheduler-screen .confirmation-label {
    font-size: 1.4rem;
  }

  #scheduler-screen .confirmation-datetime {
    font-size: 1.4rem;
    margin: 0 0 24px 0;
  }

  #scheduler-screen .confirmation-details li {
    font-size: 0.95rem;
  }

  #scheduler-screen .confirmation-details .check-icon {
    width: 20px;
    height: 20px;
  }
}
