/* person-detail-wizard.css — Person Detail Info Wizard
   Triggered on first view of a person's card in My People.
   Self-contained overlay — uses pdw- prefix throughout.
   ──────────────────────────────────────────────────────── */

/* ── Overlay ─────────────────────────────────────────────── */
/* NOTE: Use class selector (.pdw-overlay) NOT id (#pdw-overlay) so all wizards
   (person-detail, groups, pets, gatherings, gatherings-detail) share this CSS.
   Each wizard uses a different id but all share class="pdw-overlay". */
.pdw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 35, 0.72);
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.28s ease;
  color-scheme: light;   /* force light theme on the overlay itself */
}

.pdw-overlay.pdw-visible {
  opacity: 1;
}

/* ── Modal card ──────────────────────────────────────────── */
.pdw-modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  color-scheme: light;  /* always render light — never inherit OS dark mode */
  color: #1e293b;
  border-radius: 22px;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.55) inset,
    0 32px 72px rgba(0, 0, 0, 0.28),
    0 4px 18px rgba(0, 0, 0, 0.14);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90dvh;
  max-height: 90vh; /* fallback */
}

/* ── Progress bar ────────────────────────────────────────── */
.pdw-progress-bar {
  height: 4px;
  background: #eef0f5;
  flex-shrink: 0;
}

.pdw-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6C3CE1 0%, #FF5D6C 55%, #FFB830 100%);
  border-radius: 0 2px 2px 0;
  transition: width 0.36s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Close button ────────────────────────────────────────── */
.pdw-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.07);
  color: #94a3b8;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s, color 0.16s;
  line-height: 1;
  padding: 0;
}

.pdw-close:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ── Content area ────────────────────────────────────────── */
.pdw-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Hero (intro / done slides) ─────────────────────────── */
.pdw-hero {
  flex-shrink: 0;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdw-hero-emoji {
  font-size: 3.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.18));
  animation: pdw-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes pdw-pop {
  from { transform: scale(0.4) rotate(-6deg); opacity: 0; }
  to   { transform: scale(1)   rotate(0deg);  opacity: 1; }
}

/* ── Body (intro / done slides) ─────────────────────────── */
.pdw-body {
  padding: 20px 24px 10px;
  text-align: center;
}

.pdw-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.pdw-subtitle {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.55;
  margin-bottom: 12px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.pdw-hint {
  font-size: 0.8rem;
  color: #94a3b8;
  font-style: italic;
  margin-top: 6px;
}

.pdw-tip {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: #15803d;
  line-height: 1.5;
  text-align: left;
  margin-top: 4px;
}

/* ── Strip header (items slides) ────────────────────────── */
.pdw-strip {
  flex-shrink: 0;
  padding: 16px 20px 13px;
  color: #fff;
}

.pdw-strip-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 3px;
  padding-right: 36px; /* space for close btn */
}

.pdw-strip-sub {
  font-size: 0.78rem;
  opacity: 0.88;
  line-height: 1.4;
}

/* ── Items list (scrollable) ─────────────────────────────── */
.pdw-items-wrap {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.pdw-items {
  padding: 10px 16px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Single item row ────────────────────────────────────── */
.pdw-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  transition: background 0.15s;
}

.pdw-item:hover {
  background: #f0f4ff;
  border-color: #c7d2fe;
}

.pdw-item-icon {
  flex-shrink: 0;
  width: 42px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1.4rem;
  line-height: 1;
}

.pdw-item-body {
  flex: 1;
  min-width: 0;
}

.pdw-item-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
  line-height: 1.25;
}

.pdw-item-desc {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.5;
}

/* ── Footer ──────────────────────────────────────────────── */
.pdw-footer {
  flex-shrink: 0;
  padding: 10px 16px 14px;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
}

.pdw-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.pdw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.pdw-dot:hover {
  background: #94a3b8;
}

.pdw-dot-active {
  background: #6C3CE1;
  transform: scale(1.25);
}

/* ── Footer actions ─────────────────────────────────────── */
.pdw-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pdw-footer-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ── Buttons ────────────────────────────────────────────── */
.pdw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  border: none;
  transition: background 0.16s, transform 0.1s, box-shadow 0.16s;
  line-height: 1;
  white-space: nowrap;
  font-family: inherit;
}

.pdw-btn:active {
  transform: scale(0.96);
}

.pdw-btn-primary {
  background: linear-gradient(135deg, #6C3CE1, #8b5cf6);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(108, 60, 225, 0.28);
}

.pdw-btn-primary:hover {
  background: linear-gradient(135deg, #5d31c4, #7c3aed);
  box-shadow: 0 4px 14px rgba(108, 60, 225, 0.38);
}

.pdw-btn-secondary {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.pdw-btn-secondary:hover {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.pdw-btn-ghost {
  background: transparent;
  color: #64748b;
  padding: 8px 10px;
}

.pdw-btn-ghost:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* ── Responsive: small phones ──────────────────────────── */
@media (max-width: 380px) {
  .pdw-modal { border-radius: 16px; }
  .pdw-hero  { height: 100px; }
  .pdw-hero-emoji { font-size: 2.8rem; }
  .pdw-strip-title { font-size: 0.95rem; }
  .pdw-title  { font-size: 1.05rem; }
  .pdw-item   { padding: 8px 10px; gap: 10px; }
  .pdw-item-icon { width: 36px; min-height: 36px; font-size: 1.2rem; }
  .pdw-btn    { font-size: 0.76rem; padding: 7px 11px; }
  .pdw-btn-secondary { font-size: 0.7rem; padding: 6px 8px; }
}

/* ── Animate in ─────────────────────────────────────────── */
.pdw-overlay:not(.pdw-visible) .pdw-modal {
  transform: scale(0.94) translateY(12px);
}

.pdw-overlay.pdw-visible .pdw-modal {
  transform: scale(1) translateY(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}
