:root {
  /* Elegant Spa/Salon Theme */
  --bg-gradient: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
  --surface: #FFFFFF;
  --text: #1E293B;
  --muted: #64748B;
  
  /* Brand Color (Deep Teal - very popular in high-end salon apps) */
  --brand: #0F766E; 
  --brand-light: #CCFBF1;
  
  --taken: #94A3B8;
  --taken-bg: #F1F5F9;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; min-height: 100dvh;
  background: var(--bg-gradient);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, sans-serif;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  overscroll-behavior-y: none; /* Stops the elastic rubber-banding on mobile */
}

body { padding: 6vh 16px 40px 16px; }

/* Page content sits directly on the existing background gradient. */
.container-public, .container-owner {
  width: 100%;
  min-height: 550px;
  display: flex;
  flex-direction: column;
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 40px 24px;
  border: 0;
}
.container-public { max-width: 420px; } /* Typical mobile width */
.container-owner { max-width: 520px; }

header { text-align: center; margin-bottom: 32px; }
h1 {
  color: var(--text); font-weight: 700; font-size: 24px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.muted-text { color: var(--muted); font-size: 14px; font-weight: 500; }

/* Day Tabs - Soft floating pills */
.day-tab-list {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 24px;
}
.day-tab-list::-webkit-scrollbar { display: none; }

.day-tab {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 64px; min-width: 56px; padding: 12px;
  background-color: var(--taken-bg); color: var(--muted);
  border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}
.day-tab.active {
  background-color: var(--brand); color: #FFFFFF;
  box-shadow: 0 8px 16px -4px rgba(15, 118, 110, 0.4);
  transform: translateY(-2px);
}

/* Time Chips - Soft filled shapes, no harsh borders */
.time-chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 12px; margin-bottom: 24px; }

/* Make Admin grid denser to fit all 14 hours without making the card too long */
.container-owner .time-chip-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.container-owner .time-chip { padding: 8px 4px; font-size: 13px; min-height: 40px; }

.time-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; text-align: center;
  border: none; transition: all 0.2s ease;
}

.time-chip.open { background-color: var(--brand-light); color: var(--brand); }
.time-chip.open:active { transform: scale(0.95); }

.time-chip.taken { background-color: var(--taken-bg); color: var(--taken); text-decoration: line-through; cursor: not-allowed; }
.container-owner .time-chip.taken { cursor: pointer; }
.container-owner .time-chip.taken:active { transform: scale(0.95); }

/* Empty State */
.empty-state {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 140px; padding: 24px; text-align: center;
  background-color: transparent; border-radius: 20px; color: var(--muted); font-size: 15px; font-weight: 500;
}

/* Skeleton Loading Animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.skeleton-text {
  height: 28px; width: 160px; background-color: #E2E8F0; border-radius: 8px;
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  margin: 0 auto;
}
.skeleton-chip {
  height: 44px; width: 100%; background-color: #E2E8F0; border-radius: 12px;
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Client booking details */
.time-chip, .booking-button, .booking-field input, .booking-field textarea { font-family: inherit; }
.time-chip:focus-visible, .booking-button:focus-visible, .booking-back:focus-visible {
  outline: 3px solid var(--brand); outline-offset: 4px;
}
.booking-back { align-self: flex-start; color: var(--brand); font-size: 14px; margin-bottom: 24px; }
.booking-heading { margin-bottom: 24px; }
.booking-summary { background: var(--taken-bg); border-radius: 16px; padding: 16px; margin-bottom: 24px; line-height: 1.6; }
.booking-summary strong, .booking-field label { display: block; }
.booking-form { display: grid; gap: 18px; }
.booking-field label { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.booking-field input, .booking-field textarea {
  width: 100%; border: 1px solid #CBD5E1; border-radius: 12px; padding: 12px;
  font-size: 16px; color: var(--text); background: var(--surface);
}
.booking-field input:focus, .booking-field textarea:focus { outline: 2px solid var(--brand); outline-offset: 2px; }
.booking-field textarea { min-height: 110px; resize: vertical; }
.booking-button {
  width: 100%; padding: 18px 24px; border: 0; border-radius: 100px;
  background: var(--brand); color: #FFF; font-size: 16px; font-weight: 600; cursor: pointer;
}
.booking-button:disabled { opacity: 0.6; cursor: wait; }
.booking-error { color: #B91C1C; font-size: 14px; line-height: 1.5; }
[hidden] { display: none !important; }

/* Client calendar selection and confirmation */
.container-public .time-chip.open.selected {
  background: var(--brand); color: #FFF;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand);
}
.calendar-book-button { line-height: 1.4; }
.calendar-book-button:disabled { cursor: not-allowed; }

/* Client service catalogue */
.client-catalogue { margin-bottom: 32px; }
.client-section-heading { display: block; font-size: 20px; line-height: 1.4; margin-bottom: 16px; }
.catalogue-message { line-height: 1.6; margin-bottom: 20px; }
.client-service-list { display: grid; gap: 16px; }
.client-service-card { border: 1px solid #E2E8F0; border-radius: 20px; padding: 20px; overflow-wrap: anywhere; }
.client-service-card h3 { font-size: 18px; line-height: 1.4; margin-bottom: 8px; }
.client-service-card p { line-height: 1.6; margin-top: 8px; }
.client-service-description { font-size: 14px; color: var(--muted); white-space: pre-wrap; }
.client-service-price { font-size: 17px; font-weight: 700; }
.catalogue-service-button {
    width: 100%; min-height: 44px; margin-top: 16px; padding: 12px;
    font: inherit; font-size: 14px; font-weight: 600; color: var(--brand);
    background: var(--brand-light); border: 0; border-radius: 12px; cursor: pointer;
}
.catalogue-service-button[aria-pressed="true"] { color: white; background: var(--brand); }
.catalogue-service-button:disabled { color: var(--muted); background: var(--taken-bg); cursor: not-allowed; }
.catalogue-service-button:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.catalogue-selection { background: var(--taken-bg); border-radius: 16px; padding: 16px; margin-bottom: 24px; overflow-wrap: anywhere; }
.catalogue-selection strong { display: block; margin-bottom: 8px; }
.catalogue-selection p { line-height: 1.6; margin-top: 8px; }
.catalogue-stage-note { font-size: 13px; line-height: 1.6; margin-bottom: 20px; }
.catalogue-selection .catalogue-stage-note { margin-bottom: 0; }

/* Interface controls use neutral colours independently of business branding. */
.catalogue-page, .admin-page {
  --ui-action: #000;
  --ui-action-text: #FFF;
  --ui-hover: #1E293B;
  --ui-soft: #F1F5F9;
  --ui-ink: #1E293B;
  --ui-focus: #64748B;
}
.catalogue-page .time-chip.open, .admin-page .time-chip.open {
  background: var(--ui-soft); color: var(--ui-ink);
  border: 1px solid #CBD5E1;
}
.catalogue-page .time-chip.open.selected {
  background: var(--ui-action); color: var(--ui-action-text);
  border-color: var(--ui-action);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ui-action);
}
.admin-page .day-tab.active {
  background: var(--ui-action); color: var(--ui-action-text);
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .3);
}
.catalogue-page .time-chip:focus-visible, .admin-page .time-chip:focus-visible,
.admin-page .day-tab:focus-visible {
  outline: 3px solid var(--ui-focus); outline-offset: 3px;
}

/* Customer checkout keeps the same neutral controls and comfortable mobile widths. */
.details-page { padding-top:32px; }
.details-page .container-public { max-width:560px; padding:24px 8px; }
.details-page .booking-button { background:#000; color:#FFF; border-radius:12px; min-height:48px; }
.details-page .booking-back { color:#1E293B; }
.details-page .booking-field input:focus, .details-page .booking-field textarea:focus { outline-color:#64748B; }
.details-page .booking-summary-photo { width:72px; height:72px; object-fit:cover; border-radius:10px; margin-bottom:12px; }
