/**
 * Sprint 8B.1 — Companion Booking UX Intelligence Hardening
 * ==========================================================
 * Adds styles for:
 *   Phase 1  — AI Department Recommendation Card
 *   Phase 2  — Smart Auto-Selection Badge
 *   Phase 3  — (no new CSS, handled by JS state)
 *   Phase 4  — Global Home Button
 *   Phase 5  — Breadcrumb Navigation
 *   Phase 6  — Booking Recovery Banner
 *   Zero breaking changes — all class names are new prefixed with .s8b1-
 */

/* ── Phase 1: AI Recommendation Card ─────────────────────────────────── */
.s8b1-ai-rec-card {
  background: linear-gradient(135deg, rgba(13,148,136,0.07) 0%, rgba(255,255,255,0) 100%);
  border: 2px solid rgba(13,148,136,0.22);
  border-radius: 1rem;
  padding: 1.1rem 1rem 0.9rem;
  margin-bottom: 0.85rem;
  position: relative;
  overflow: hidden;
}

.s8b1-ai-rec-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0d9488, #14b8a6, #5eead4);
  border-radius: 1rem 1rem 0 0;
}

.s8b1-ai-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #0d9488;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.55rem;
}

.s8b1-ai-label .s8b1-ai-pulse {
  width: 8px;
  height: 8px;
  background: #0d9488;
  border-radius: 50%;
  animation: s8b1-pulse 1.6s ease-in-out infinite;
}

@keyframes s8b1-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.4); }
}

.s8b1-dept-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--c-text);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.s8b1-reason {
  font-size: 0.82rem;
  color: var(--c-muted);
  margin-bottom: 0.65rem;
  line-height: 1.5;
}

/* Confidence bar */
.s8b1-confidence-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.s8b1-confidence-label {
  font-size: 0.72rem;
  color: var(--c-muted);
  white-space: nowrap;
}

.s8b1-confidence-track {
  flex: 1;
  height: 7px;
  background: var(--c-border);
  border-radius: 999px;
  overflow: hidden;
}

.s8b1-confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16,1,0.3,1);
}

.s8b1-confidence-pct {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0d9488;
  min-width: 36px;
  text-align: right;
}

/* Action buttons row */
.s8b1-rec-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.s8b1-btn-continue {
  flex: 1;
  min-height: 52px;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #fff;
  border: none;
  border-radius: 0.85rem;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(13,148,136,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.s8b1-btn-continue:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(13,148,136,0.25);
}

.s8b1-btn-choose-diff {
  flex: 0 0 auto;
  min-height: 52px;
  background: transparent;
  color: var(--c-muted);
  border: 1.5px solid var(--c-border);
  border-radius: 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 1rem;
  transition: color 0.15s, border-color 0.15s;
}

.s8b1-btn-choose-diff:hover {
  color: var(--c-primary);
  border-color: var(--c-primary);
}

/* Full department list (shown when patient clicks Choose Different) */
.s8b1-dept-list-wrap {
  margin-top: 0.85rem;
  animation: s8b1-slideDown 0.25s ease;
}

@keyframes s8b1-slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.s8b1-dept-list-wrap .s8b1-dept-list-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.6rem;
}

.s8b1-dept-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.s8b1-dept-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: 0.75rem;
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text);
  transition: background 0.12s, border-color 0.12s;
  width: 100%;
}

.s8b1-dept-btn:hover,
.s8b1-dept-btn.selected {
  background: var(--c-primary-light);
  border-color: var(--c-primary);
  color: var(--c-primary-dark);
}

/* ── Phase 2: Smart Auto-Selection Badge ──────────────────────────────── */
.s8b1-auto-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(13,148,136,0.10);
  border: 1.5px solid rgba(13,148,136,0.25);
  border-radius: 999px;
  padding: 5px 12px 5px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0d9488;
  margin-bottom: 0.65rem;
}

.s8b1-auto-badge .s8b1-auto-icon {
  font-size: 0.95rem;
}

/* ── Phase 4: Global Home Button ──────────────────────────────────────── */
.s8b1-home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: 0.6rem;
  color: var(--c-muted);
  font-size: 0.78rem;
  font-weight: 700;
  transition: color 0.15s, background 0.15s;
}

.s8b1-home-btn:hover {
  color: var(--c-primary);
  background: var(--c-primary-light);
}

.s8b1-home-btn svg,
.s8b1-home-btn i {
  font-size: 1rem;
}

/* Floating home button variant (visible on all booking steps) */
.s8b1-home-fab {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  width: 48px;
  height: 48px;
  background: #0d9488;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(13,148,136,0.40);
  color: #fff;
  font-size: 1.1rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.s8b1-home-fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(13,148,136,0.30);
}

/* ── Phase 5: Breadcrumb Navigation ──────────────────────────────────── */
.s8b1-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.6rem 1rem 0.5rem;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  /* Replaces the numeric step dots */
}

.s8b1-breadcrumb::-webkit-scrollbar { display: none; }

.s8b1-crumb {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-subtle);
  cursor: default;
  padding: 3px 0;
  transition: color 0.15s;
  flex-shrink: 0;
}

.s8b1-crumb.done {
  color: #0d9488;
  cursor: pointer;
}

.s8b1-crumb.active {
  color: var(--c-text);
  font-weight: 800;
}

.s8b1-crumb .s8b1-crumb-icon {
  font-size: 0.78rem;
}

.s8b1-crumb-sep {
  margin: 0 0.25rem;
  font-size: 0.65rem;
  color: var(--c-border);
  flex-shrink: 0;
  user-select: none;
}

/* ── Phase 6: Booking Recovery Banner ────────────────────────────────── */
.s8b1-recovery-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(13,148,136,0.09), rgba(13,148,136,0.04));
  border: 1.5px solid rgba(13,148,136,0.22);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  margin: 0 0 0.85rem;
  animation: s8b1-slideDown 0.3s ease;
}

.s8b1-recovery-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.s8b1-recovery-text {
  flex: 1;
}

.s8b1-recovery-text strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--c-text);
  margin-bottom: 0.15rem;
}

.s8b1-recovery-text span {
  font-size: 0.76rem;
  color: var(--c-muted);
}

.s8b1-recovery-btn {
  flex-shrink: 0;
  background: #0d9488;
  color: #fff;
  border: none;
  border-radius: 0.65rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.s8b1-recovery-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--c-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

/* ── Home button in header of book screen ─────────────────────────────── */
.s8b1-header-home-wrap {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Mobile first: ensure the header home btn visible on small screens */
@media (max-width: 480px) {
  .s8b1-home-btn {
    font-size: 0.72rem;
    padding: 0.3rem 0.5rem;
  }
}
