/**
 * Pampered Paws Design System v4.1 — Soft UI components
 * Bottom sheets, choice cards, listing cards, metrics, pills, bottom nav.
 */

/* ── Sheet modal (bridges .modal-overlay + .staff-modal-panel) ── */
.pp-v4 .modal-overlay,
.pp-v4 .booking-detail-modal,
body > .modal-overlay.pp-v4,
body > .booking-detail-modal.pp-v4 {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pp-v4 .modal-overlay.active {
  align-items: flex-end;
  padding: 0;
}

.pp-v4 .staff-dashboard .modal-overlay.active > .staff-modal-panel,
.pp-v4 #pp-staff-dashboard-root .modal-overlay.active > .staff-modal-panel,
.pp-v4 .modal-overlay.active > .staff-modal-panel {
  width: 100% !important;
  max-width: 100% !important;
  border-radius: var(--pp-radius-2xl) var(--pp-radius-2xl) 0 0 !important;
  box-shadow: var(--pp-shadow-sheet) !important;
  animation: pp-sheet-up var(--pp-duration-slow) var(--pp-ease);
}

.pp-v4 .booking-detail-modal.active .bdm-content {
  border-radius: var(--pp-radius-2xl) var(--pp-radius-2xl) 0 0;
  animation: pp-sheet-up var(--pp-duration-slow) var(--pp-ease);
}

@keyframes pp-sheet-up {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (min-width: 769px) {
  .pp-v4 .modal-overlay.active {
    align-items: center;
    padding: var(--pp-space-4);
  }
  .pp-v4 .staff-dashboard .modal-overlay.active > .staff-modal-panel,
  .pp-v4 #pp-staff-dashboard-root .modal-overlay.active > .staff-modal-panel,
  .pp-v4 .modal-overlay.active > .staff-modal-panel {
    width: min(600px, 92vw) !important;
    max-width: min(720px, 92vw) !important;
    border-radius: var(--pp-radius-2xl) !important;
    animation: pp-modal-in var(--pp-duration-slow) var(--pp-ease);
  }
  .pp-v4 .booking-detail-modal.active {
    align-items: center;
    padding: var(--pp-space-6) var(--pp-space-4);
  }
  .pp-v4 .booking-detail-modal.active .bdm-content {
    border-radius: var(--pp-radius-2xl);
    max-width: 560px;
    animation: pp-modal-in var(--pp-duration-slow) var(--pp-ease);
  }
}

/* ── Primary pill CTA ── */
.pp-v4 .action-btn.primary,
.pp-v4 .modal-footer .action-btn.primary,
.pp-v4 .dash-btn-primary {
  background: var(--pp-cta) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--pp-radius-full) !important;
  font-weight: 700 !important;
  box-shadow: var(--pp-shadow-sm) !important;
}

.pp-v4 .action-btn.primary:hover,
.pp-v4 .dash-btn-primary:hover {
  background: var(--pp-cta-hover) !important;
  transform: translateY(-1px);
}

/* ── Metric hero / stat cards ── */
.pp-v4 .stat-card,
.pp-v4 .dash-card {
  background: var(--pp-surface);
  border: none;
  border-radius: var(--pp-radius-xl);
  box-shadow: var(--pp-shadow-soft);
}

.pp-v4 .stat-value {
  font-weight: 800;
  letter-spacing: var(--pp-tracking-tight);
  color: var(--pp-ink);
}

.pp-v4 .stat-card {
  padding: var(--pp-space-5);
}

/* ── Category pills (Airbnb-style) ── */
.pp-category-pills {
  display: flex;
  gap: var(--pp-space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: var(--pp-space-1) 0;
}

.pp-category-pills::-webkit-scrollbar { display: none; }

.pp-category-pills .tab-btn {
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: var(--pp-radius-full);
  border: 1px solid var(--pp-border);
  background: var(--pp-surface);
  color: var(--pp-ink-secondary);
  font-weight: 600;
  font-size: var(--pp-text-sm);
  box-shadow: var(--pp-shadow-xs);
  border-bottom: 1px solid var(--pp-border) !important;
  transition: background var(--pp-duration) var(--pp-ease),
              box-shadow var(--pp-duration) var(--pp-ease),
              color var(--pp-duration) var(--pp-ease);
}

.pp-category-pills .tab-btn:hover {
  border-color: var(--pp-border-strong);
  color: var(--pp-ink);
}

.pp-category-pills .tab-btn.active {
  background: var(--pp-ink);
  color: #fff;
  border-color: var(--pp-ink);
  box-shadow: var(--pp-shadow-sm);
}

.pp-v4 .svc-filter-bar {
  gap: var(--pp-space-2);
  padding: var(--pp-space-2) 0 var(--pp-space-3);
}

.pp-v4 .svc-filter-btn {
  border-radius: var(--pp-radius-full);
  border: 1px solid var(--pp-border);
  background: var(--pp-surface);
  box-shadow: var(--pp-shadow-xs);
  font-weight: 600;
}

.pp-v4 .svc-filter-btn.active {
  background: var(--pp-ink);
  color: #fff;
  border-color: var(--pp-ink);
}

/* ── Choice card (activity-status rows) ── */
.pp-choice-card {
  display: flex;
  align-items: center;
  gap: var(--pp-space-4);
  padding: var(--pp-space-4);
  background: var(--pp-surface);
  border-radius: var(--pp-radius-lg);
  box-shadow: var(--pp-shadow-soft);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--pp-duration) var(--pp-ease),
              box-shadow var(--pp-duration) var(--pp-ease);
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.pp-choice-card:hover {
  box-shadow: var(--pp-shadow);
}

.pp-choice-card.is-selected {
  border-color: var(--pp-brand-400);
  box-shadow: 0 0 0 4px var(--pp-primary-ring);
}

.pp-choice-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--pp-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  color: #fff;
  box-shadow: var(--pp-shadow-glow);
}

.pp-choice-card__body { flex: 1; min-width: 0; }
.pp-choice-card__title { font-weight: 700; color: var(--pp-ink); font-size: var(--pp-text-base); }
.pp-choice-card__sub { font-size: var(--pp-text-sm); color: var(--pp-muted); margin-top: 2px; }

/* ── Listing card ── */
.pp-listing-card {
  background: var(--pp-surface);
  border-radius: var(--pp-radius-xl);
  overflow: hidden;
  box-shadow: var(--pp-shadow-soft);
  transition: box-shadow var(--pp-duration) var(--pp-ease), transform var(--pp-duration) var(--pp-ease);
}

.pp-listing-card:hover {
  box-shadow: var(--pp-shadow);
  transform: translateY(-2px);
}

.pp-listing-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--pp-bg-subtle);
  overflow: hidden;
}

.pp-listing-card__badge {
  position: absolute;
  top: var(--pp-space-3);
  left: var(--pp-space-3);
  padding: 4px 10px;
  border-radius: var(--pp-radius-full);
  background: var(--pp-surface);
  font-size: var(--pp-text-xs);
  font-weight: 700;
  box-shadow: var(--pp-shadow-sm);
}

.pp-listing-card__body { padding: var(--pp-space-4); }
.pp-listing-card__title { font-weight: 700; font-size: var(--pp-text-base); color: var(--pp-ink); }
.pp-listing-card__meta { font-size: var(--pp-text-sm); color: var(--pp-muted); margin-top: 4px; }

/* ── Search pill ── */
.pp-search-pill {
  display: flex;
  align-items: center;
  gap: var(--pp-space-3);
  padding: var(--pp-space-3) var(--pp-space-5);
  background: var(--pp-surface);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius-full);
  box-shadow: var(--pp-shadow-soft);
  width: 100%;
  max-width: 640px;
}

.pp-search-pill input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--pp-text-base);
  font-family: inherit;
  color: var(--pp-ink);
  outline: none;
}

.pp-search-pill input::placeholder { color: var(--pp-muted-light); }

/* ── Bottom navigation ── */
.pp-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  height: var(--pp-bottom-nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--pp-border);
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
}

.pp-bottom-nav__inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  height: 100%;
  max-width: var(--pp-max-width);
  margin: 0 auto;
  padding: 6px 8px 8px;
}

.pp-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  border: none;
  background: transparent;
  color: var(--pp-muted);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--pp-radius);
  min-height: 44px;
  position: relative;
  transition: color var(--pp-duration) var(--pp-ease);
}

.pp-bottom-nav__item i {
  font-size: 1.15rem;
  line-height: 1;
}

.pp-bottom-nav__item.is-active {
  color: var(--pp-brand-600);
}

.pp-bottom-nav__item--book {
  align-self: center;
  margin-top: -22px;
  position: relative;
  z-index: 2;
}

.pp-bottom-nav__item--book .pp-bottom-nav__fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--pp-cta);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: var(--pp-shadow-lg);
  border: 3px solid var(--pp-surface);
}

.pp-bottom-nav__badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #7c3aed;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pp-bottom-nav__badge[hidden] { display: none !important; }

@media (max-width: 1024px) {
  .pp-v4 .pp-bottom-nav--staff {
    display: block;
  }
}

@media (max-width: 768px) {
  .pp-v4 .pp-bottom-nav { display: block; }

  .pp-v4.staff-dashboard,
  .pp-v4 .staff-dashboard,
  .pp-v4.dashboard-wrapper,
  .pp-v4 .dashboard-wrapper,
  .pp-v4.pp-has-bottom-nav,
  .pp-v4 .pp-has-bottom-nav {
    padding-bottom: var(--pp-bottom-nav-safe);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pp-v4 .modal-overlay.active > .staff-modal-panel,
  .pp-v4 .booking-detail-modal.active .bdm-content {
    animation: none;
  }
}
