/*
  Dashboard Camper (Phase 2 additions)
  Path: css/dash-camper.css

  New, page-spanning styles introduced by the overview/details/feedback
  split: the Camper Card photo, reference-code copy button, countdown
  widget, nav notification bell, focus-visible states, and the
  unsaved-changes / last-saved / validation touches from details.html.
  Load after dashboard-v2.css.
*/

/* ================= Camper Card: circular photo ================= */

.dash-card-photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.dash-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(247, 243, 236, 0.25);
  background-color: rgba(247, 243, 236, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: rgba(247, 243, 236, 0.85);
}

.dash-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dash-card-avatar.is-placeholder {
  font-style: italic;
}

/* Peek / compact state (mobile, once scrolled past on details.html) */

.dash-card-avatar.is-peek-size {
  width: 30px;
  height: 30px;
  font-size: 0.75rem;
  border-width: 1.5px;
}

/* Copy reference code */

.dash-refcode-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dash-copy-ref-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: none;
  color: rgba(247, 243, 236, 0.55);
  cursor: pointer;
  transition: color var(--dur-instant) ease, background-color var(--dur-instant) ease, transform var(--dur-instant) var(--ease-snap);
}

.dash-copy-ref-btn:hover {
  color: rgba(247, 243, 236, 0.95);
  background-color: rgba(247, 243, 236, 0.12);
}

.dash-copy-ref-btn:active {
  transform: scale(0.9);
}

/* ================= Countdown widget ================= */

.dash-countdown-card {
  margin-top: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.dash-countdown-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.dash-countdown-numbers {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.dash-countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dash-countdown-unit strong {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-accent);
  line-height: 1;
}

.dash-countdown-unit small {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ================= Nav notification bell ================= */

.dash-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface-raised);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--dur-quick) var(--ease-signature), transform var(--dur-instant) var(--ease-snap);
}

.dash-bell-btn:hover {
  border-color: var(--color-accent);
}

.dash-bell-btn:active {
  transform: scale(0.94);
}

.dash-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background-color: var(--color-accent);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-bg);
}

/* ================= Focus-visible, keyboard nav parity ================= */

.locked-field-ask-btn:focus-visible,
.dash-copy-ref-btn:focus-visible,
.dash-bell-btn:focus-visible,
.feedback-rating-option:focus-visible,
.theme-toggle-icon:focus-visible,
.locked-field-row:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.feedback-rating-option {
  cursor: pointer;
}

/* ================= Locked-details empty state parity ================= */

.dash-locked-empty {
  padding: 32px 20px;
  text-align: center;
}

/* ================= Announcements: restyled cards ================= */

.announcement-feed-v2 {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.announcement-card-v2 {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  background-color: var(--color-surface);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur-quick) var(--ease-signature),
              transform var(--dur-quick) var(--ease-snap),
              box-shadow var(--dur-quick) var(--ease-signature);
}

.announcement-card-v2:hover,
.announcement-card-v2:focus-visible {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.announcement-card-v2.is-unread {
  border-left: 3px solid var(--color-accent);
}

.announcement-card-v2-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.announcement-new-pill {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-accent);
  background-color: rgba(217, 84, 31, 0.12);
  border-radius: 999px;
  padding: 3px 10px;
}

.announcement-card-v2-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.announcement-card-v2-preview {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.announcement-card-v2-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-accent);
}

.announcement-card-v2-cta svg {
  transition: transform var(--dur-quick) var(--ease-snap);
}

.announcement-card-v2:hover .announcement-card-v2-cta svg {
  transform: translateX(3px);
}

/* ================= Bell dropdown panel ================= */

.dash-bell-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
  width: min(90vw, 340px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-card);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transition: opacity var(--dur-quick) var(--ease-signature),
              transform var(--dur-quick) var(--ease-snap),
              visibility 0s linear var(--dur-quick);
}

.dash-bell-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity var(--dur-quick) var(--ease-signature),
              transform var(--dur-quick) var(--ease-snap),
              visibility 0s linear 0s;
}

.dash-bell-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background-color var(--dur-instant) ease;
}

.dash-bell-item:hover {
  background-color: var(--color-surface-raised);
}

.dash-bell-item-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background-color: transparent;
}

.dash-bell-item.is-unread .dash-bell-item-dot {
  background-color: var(--color-accent);
}

.dash-bell-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-bell-item-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-bell-item-date {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-text-muted);
}

.dash-bell-empty {
  padding: 20px 10px;
  text-align: center;
}

.dash-bell-viewall {
  display: block;
  text-align: center;
  padding: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}

.dash-bell-viewall:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .dash-bell-panel {
    position: fixed;
    top: 64px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dash-bell-panel { transition: opacity var(--dur-instant) ease; transform: none !important; }
}

/* ================= Announcement detail page ================= */

.announcement-detail-shell {
  max-width: 640px;
  padding-block: 90px 96px;
}

.announcement-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-bottom: 28px;
}

.announcement-back-link:hover {
  color: var(--color-accent);
}

.announcement-detail-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  overflow: hidden;
}

.announcement-detail-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: var(--color-accent);
}

.announcement-detail-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.announcement-detail-title {
  font-size: var(--fs-2xl);
  margin-bottom: 24px;
  line-height: 1.2;
}

.announcement-detail-body {
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.7;
}

.announcement-detail-body p {
  margin-bottom: 16px;
}

.announcement-detail-body p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .announcement-detail-shell { padding-block: 72px 64px; }
  .announcement-detail-card { padding: 28px 22px; }
}

/* ================= Feedback rating microcopy ================= */

.feedback-rating-microcopy {
  min-height: 20px;
  font-size: var(--fs-sm);
  color: var(--color-accent);
  font-weight: 500;
  margin-top: -6px;
  margin-bottom: 20px;
  opacity: 0;
}

.feedback-rating-microcopy.is-visible {
  animation: dash-fade-up var(--dur-moment) var(--ease-signature) both;
}

@media (prefers-reduced-motion: reduce) {
  .feedback-rating-microcopy.is-visible { animation: none; opacity: 1; }
}

/* Slightly larger, more tactile rating circles */
.feedback-rating-option {
  width: 48px;
  height: 48px;
  font-size: 1.0625rem;
}

@media (max-width: 480px) {
  .feedback-rating-option { width: 42px; height: 42px; font-size: 0.9375rem; }
}

/* ================= BUG FIX: textarea resize-handle artifact ================= */
/* The native browser resize grip (bottom-right corner of any <textarea>,
   default resize:both) renders as a light, unthemed triangular glyph
   that doesn't respect dark mode. Against a rounded dark box (e.g. the
   dietary/medical notes field) it reads as a broken, detached notch
   cut into the corner. Disabling native resize removes the artifact
   entirely rather than trying to theme something the browser doesn't
   expose a styling hook for. Rows are sized generously enough (3+)
   that manual resize isn't needed. */
.dash-panel textarea,
.request-change-form textarea {
  resize: none;
}

/* ================= Inline field validation ================= */

.field.has-error input {
  border-color: var(--color-danger);
}

.field-error-text {
  color: var(--color-danger);
  font-size: var(--fs-xs);
  margin-top: 6px;
  display: none;
}

.field-error-text.is-visible {
  display: block;
  animation: dash-field-shake var(--dur-quick) var(--ease-signature);
}

@keyframes dash-field-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .field-error-text.is-visible { animation: none; }
}

/* ================= Last-saved timestamp ================= */

.dash-last-saved {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-top: 6px;
}

/* ================= Unsaved-changes indicator ================= */

.dash-unsaved-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--color-warning);
  font-weight: 600;
}

.dash-unsaved-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-warning);
}

/* ================= Custom themed select ================= */
/* Replaces the native <select> for pickup point / relationship, whose
   OS-native option highlight clashed with dark mode. Reinvented for
   this product rather than ported from the admin table's version. */

.dash-select {
  position: relative;
}

.dash-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  color: var(--color-text);
  font-size: var(--fs-sm);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--dur-quick) ease;
}

.dash-select-trigger:hover,
.dash-select.is-open .dash-select-trigger {
  border-color: var(--color-accent);
}

.dash-select-trigger svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform var(--dur-quick) var(--ease-signature);
}

.dash-select.is-open .dash-select-trigger svg {
  transform: rotate(180deg);
}

.dash-select-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-card);
  display: none;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition: opacity var(--dur-quick) var(--ease-signature), transform var(--dur-quick) var(--ease-snap);

  /* Themed scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.dash-select-list::-webkit-scrollbar { width: 8px; }
.dash-select-list::-webkit-scrollbar-thumb { background-color: var(--color-border); border-radius: 999px; }

.dash-select.is-open .dash-select-list {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dash-select-option {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background-color var(--dur-instant) ease;
}

.dash-select-option:hover,
.dash-select-option:focus-visible {
  background-color: var(--color-surface-raised);
}

.dash-select-option.is-selected {
  background-color: rgba(217, 84, 31, 0.1);
  color: var(--color-accent);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .dash-select-list,
  .dash-select-trigger svg {
    transition: opacity var(--dur-instant) ease;
    transform: none !important;
  }
}

/* ================= Status chips: confident completed state ================= */
/* The completed icon previously went transparent-background, losing
   its badge weight right at the moment it should feel most resolved.
   A filled, glowing circle reads as "done" rather than "outlined". */

.dash-status-chip.is-complete .chip-icon {
  background-color: var(--color-sage);
  color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(122, 155, 118, 0.15);
}

html[data-theme="dark"] .dash-status-chip.is-complete .chip-icon {
  box-shadow: 0 0 0 4px rgba(143, 176, 138, 0.18);
}

/* Readiness header: gives the pair of chips a shared frame and a
   sense of progress ("2 of 2") rather than floating loose. */

.dash-readiness-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dash-readiness-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
}

.dash-readiness-count {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-sage);
  background-color: var(--color-success-bg);
  border-radius: 999px;
  padding: 3px 10px;
}

.dash-readiness-count.is-pending {
  color: var(--color-warning);
  background-color: var(--color-warning-bg);
}

/* Tighten the stage capsule glow so it reads as a focused signal
   rather than a diffuse haze around the whole pill. */

.dash-stage-capsule.is-attention {
  box-shadow: 0 0 0 1px rgba(193, 67, 47, 0.12);
}
/* ================= Consent panel: dark-mode input + overflow fix ================= */
/* .consent-box/.consent-link-row come from register.css, loaded on
   this page, but its dark-mode input override lives in register-v2.css,
   which this page does NOT load — so the field fell through to the
   browser's unstyled white input. Restated here instead of pulling in
   a whole second stylesheet for one rule. Also guards the same
   min-width: auto flex-overflow trap the registration dropdowns hit:
   a long consent URL will force this row wider than its panel unless
   the input is explicitly allowed to shrink. */

.consent-link-row {
  min-width: 0;
}

.consent-link-row input {
  min-width: 0;
  flex: 1;
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}