/* ═══════════════════════════════════════════════
   Schedule Page — CallYourKid
   3-Step: Select Case → Pick Time → Confirm
═══════════════════════════════════════════════ */

/* Page Header */
.sched-header {
  background: linear-gradient(135deg, var(--navy) 0%, #2a4a7a 100%);
  padding: 48px 24px 40px;
  text-align: center;
  color: white;
}
.sched-header-inner { max-width: 600px; margin: 0 auto; }
.sched-header h1 {
  font-family: 'Nunito', sans-serif;
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 10px;
  color: white;
}
.sched-header p {
  font-family: 'Lora', serif;
  font-size: 17px;
  color: rgba(255,255,255,0.82);
  margin: 0;
}

/* ─── Steps Bar ──────────────────────────────── */
.steps-bar {
  background: white;
  border-bottom: 2px solid var(--gray-100);
  padding: 20px 24px;
  position: sticky;
  top: 68px;
  z-index: 100;
}
.steps-inner {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 80px;
}
.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 16px;
  transition: all 0.3s;
}
.step-item span {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-400);
  text-align: center;
  transition: color 0.3s;
}
.step-item.active .step-circle {
  background: var(--orange);
  color: white;
}
.step-item.active span { color: var(--navy); }
.step-item.completed .step-circle {
  background: var(--teal);
  color: white;
}
.step-item.completed span { color: var(--teal); }
.step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-100);
  margin-bottom: 18px;
  min-width: 40px;
}

/* ─── Page Loading ───────────────────────────── */
.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 16px;
  color: var(--gray-600);
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-100);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Error Screen ───────────────────────────── */
.sched-error-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
  text-align: center;
  padding: 40px 24px;
}
.error-icon { font-size: 64px; }
.sched-error-screen h2 { font-size: 28px; color: var(--navy); }
.sched-error-screen p { color: var(--gray-600); font-size: 16px; }

/* ─── Step Container ─────────────────────────── */
.sched-step { padding: 40px 24px 60px; }
.sched-container {
  max-width: 1100px;
  margin: 0 auto;
}
.sched-narrow {
  max-width: 620px;
  margin: 0 auto;
}
.sched-two-col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.step-heading { text-align: center; margin-bottom: 36px; }
.step-heading h2 {
  font-family: 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}
.step-heading p {
  font-family: 'Lora', serif;
  color: var(--gray-600);
  font-size: 16px;
}

/* ─── Case Cards ─────────────────────────────── */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.case-card {
  background: white;
  border: 2px solid var(--gray-100);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.case-card:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 24px rgba(37,99,235,0.12);
  transform: translateY(-2px);
}
.case-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.case-type-badge {
  display: inline-block;
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
}
.case-status-badge {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--sky);
  color: var(--navy);
}
.case-status-badge.active { background: #d1fae5; color: #065f46; }
.case-status-badge.suspended { background: #fee2e2; color: #991b1b; }
.case-number {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}
.case-meta {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--gray-400);
}
.case-select-btn {
  margin-top: 4px;
  width: 100%;
  text-align: center;
  padding: 10px 20px;
  font-size: 14px;
}

/* ─── Empty State ────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 40px;
  background: var(--gray-50);
  border-radius: 16px;
  border: 2px dashed var(--gray-100);
  max-width: 480px;
  margin: 0 auto;
}
.empty-state.small { padding: 32px 24px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 {
  font-family: 'Nunito', sans-serif;
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 12px;
}
.empty-state p {
  font-family: 'Lora', serif;
  color: var(--gray-600);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ─── Back Button ────────────────────────────── */
.back-btn {
  background: none;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  padding: 0 0 20px 0;
  display: inline-block;
}
.back-btn:hover { color: var(--navy); }

/* ─── Selected Case Banner ───────────────────── */
.selected-case-banner {
  background: var(--sky);
  border-radius: 12px;
  padding: 14px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 20px;
}
.banner-label { color: var(--gray-600); }

/* ─── Restrictions Box ───────────────────────── */
.restrictions-box {
  background: #fff7ed;
  border: 2px solid #fed7aa;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.restriction-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 10px;
}
.restriction-item {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 6px;
}

/* ─── Calendar ───────────────────────────────── */
.calendar-card {
  background: white;
  border-radius: 16px;
  border: 2px solid var(--gray-100);
  padding: 24px;
  margin-bottom: 24px;
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.cal-month-label {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}
.cal-nav-btn {
  background: var(--gray-50);
  border: 2px solid var(--gray-100);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 20px;
  cursor: pointer;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.cal-nav-btn:hover { background: var(--sky); border-color: var(--blue); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day-header {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-align: center;
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#cal-days {
  display: contents;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: default;
  position: relative;
  transition: all 0.15s;
  gap: 2px;
}
.cal-cell.empty { background: transparent; }
.cal-cell.past { color: var(--gray-400); background: transparent; }
.cal-cell.no-slots { color: var(--gray-600); background: var(--gray-50); }
.cal-cell.has-slots {
  background: #e0f0ff;
  color: var(--navy);
  cursor: pointer;
  border: 2px solid transparent;
}
.cal-cell.has-slots:hover {
  background: var(--sky);
  border-color: var(--blue);
}
.cal-cell.selected {
  background: var(--orange);
  color: white;
  cursor: pointer;
}
.slot-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  display: block;
}
.cal-cell.selected .slot-dot { background: white; }

/* ─── Slots ──────────────────────────────────── */
.slots-heading {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 16px;
}
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.slot-card {
  background: white;
  border: 2px solid var(--gray-100);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slot-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 16px rgba(37,99,235,0.12);
  transform: translateY(-1px);
}
.slot-card.chosen {
  border-color: var(--orange);
  background: #fff7ed;
  box-shadow: 0 4px 16px rgba(249,115,22,0.15);
}
.slot-card.blocked {
  background: var(--gray-50);
  border-color: var(--gray-100);
  cursor: not-allowed;
  opacity: 0.65;
}
.slot-time {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
}
.slot-duration {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
}
.slot-supervisor {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--gray-600);
}
.slot-price {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--orange);
  margin-top: 4px;
}
.slot-blocked-reason {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: #991b1b;
}

/* ─── Sidebar ────────────────────────────────── */
.sched-sidebar { display: flex; flex-direction: column; gap: 16px; }
.sidebar-card {
  background: white;
  border: 2px solid var(--gray-100);
  border-radius: 16px;
  padding: 24px;
  position: sticky;
  top: 140px;
}
.sidebar-card h3 {
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 20px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.summary-row:last-of-type { border-bottom: none; }
.summary-label {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}
.summary-val {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  text-align: right;
}
.summary-divider { height: 1px; background: var(--gray-100); margin: 8px 0; }
.total-row .summary-label { font-size: 14px; font-weight: 800; color: var(--navy); }
.total-row .summary-val { font-size: 16px; color: var(--orange); }
.full-width { width: 100%; justify-content: center; margin-top: 20px; }
.full-width:disabled { opacity: 0.5; cursor: not-allowed; }

.sidebar-info-card {
  background: var(--warm);
  border-radius: 14px;
  padding: 20px;
}
.sidebar-info-card h4 {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
}
.sidebar-info-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-info-card li {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--gray-600);
  padding-left: 16px;
  position: relative;
}
.sidebar-info-card li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--orange);
  font-weight: 800;
}

/* ─── Confirm Card ───────────────────────────── */
.confirm-card {
  background: white;
  border-radius: 20px;
  border: 2px solid var(--gray-100);
  padding: 40px;
}
.confirm-header {
  text-align: center;
  margin-bottom: 32px;
}
.confirm-icon { font-size: 52px; margin-bottom: 16px; }
.confirm-header h2 {
  font-family: 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}
.confirm-header p {
  font-family: 'Lora', serif;
  color: var(--gray-600);
  font-size: 15px;
}
.confirm-details {
  background: var(--gray-50);
  border-radius: 14px;
  padding: 8px 24px;
  margin-bottom: 24px;
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
}
.confirm-row:last-child { border-bottom: none; }
.confirm-label {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-600);
}
.confirm-val {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
}
.highlight-row { background: var(--warm); margin: 0 -24px; padding: 14px 24px; border-radius: 0 0 14px 14px; }
.highlight-row .confirm-val { color: var(--orange); font-size: 18px; }

.confirm-notices {
  background: var(--sky);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notice-item {
  display: flex;
  gap: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--navy);
}
.notice-icon { flex-shrink: 0; }

.booking-error {
  background: #fee2e2;
  border: 2px solid #fca5a5;
  border-radius: 10px;
  padding: 14px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: #991b1b;
  margin-bottom: 20px;
}
.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.large-btn {
  padding: 16px 40px;
  font-size: 17px;
  width: 100%;
  text-align: center;
  justify-content: center;
}
.confirm-actions .btn-ghost {
  padding: 10px 32px;
  font-size: 14px;
}

/* ─── Success ────────────────────────────────── */
.success-card {
  background: white;
  border-radius: 20px;
  border: 2px solid #d1fae5;
  padding: 48px 40px;
  text-align: center;
}
.success-anim {
  font-size: 72px;
  margin-bottom: 20px;
  display: block;
}
.success-card h2 {
  font-family: 'Nunito', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
}
.success-card p {
  font-family: 'Lora', serif;
  color: var(--gray-600);
  font-size: 16px;
  margin-bottom: 32px;
  line-height: 1.6;
}
.success-details {
  background: var(--gray-50);
  border-radius: 14px;
  padding: 8px 24px;
  margin-bottom: 32px;
  text-align: left;
}
.success-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--gray-600);
}
.success-detail-row:last-child { border-bottom: none; }
.success-detail-row strong { color: var(--navy); font-size: 15px; }
.success-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 900px) {
  .sched-two-col {
    grid-template-columns: 1fr;
  }
  .sched-sidebar { position: static; }
  .sidebar-card { position: static; }
}
@media (max-width: 600px) {
  .sched-header h1 { font-size: 26px; }
  .sched-step { padding: 24px 16px 48px; }
  .confirm-card { padding: 24px 20px; }
  .success-card { padding: 32px 20px; }
  .slots-grid { grid-template-columns: 1fr 1fr; }
  .cases-grid { grid-template-columns: 1fr; }
  .success-actions { flex-direction: column; }
}
