/* Waypoint platform styles. Layered on top of Tailwind.
   Only things Tailwind can't express cleanly live here. */

/* The complete token set. Values mirror build/tailwind.config.js exactly —
   that file carries the measured-contrast rationale; this one just exposes the
   palette to hand-written CSS. Keep the two in lockstep. */
:root {
  --wp-brand:    #1B4D3E;
  --wp-brand2:   #16402F;
  --wp-brand3:   #E8F5F0;
  --wp-ink:      #0B1220;
  --wp-ink2:     #38404D;
  --wp-muted:    #67707D;
  --wp-line:     #E6E9EE;
  --wp-line2:    #D2D7DE;
  --wp-surface:  #F7F9FC;
  --wp-surface2: #F0F3F8;
  --wp-bg:       #FFFFFF;
  --wp-success:  #16A35B;   /* fill/icon only */
  --wp-success2: #0E7C44;   /* text-safe */
  --wp-warning:  #E0A41F;   /* fill/icon only */
  --wp-warning2: #8A5A00;   /* text-safe */
  --wp-danger:   #D14343;
  --wp-danger2:  #C13A3A;   /* text-safe on tinted surfaces */

  --wp-r-card: 12px;        /* one card radius (rounded-xl) */
  --wp-r-control: 8px;      /* one control radius (rounded-lg) */
  --wp-pad-card: 24px;
  --wp-t-fast: 160ms;       /* inside the 150-300ms working range */
}

html, body { min-height: 100vh; }
body {
  font-feature-settings: "ss01", "cv11", "tnum";
  -webkit-tap-highlight-color: transparent;
}

/* Text rendering on retina */
.wp-display { letter-spacing: -0.02em; }

/* Accent rule — thin green line used as section marker */
.wp-rule {
  display: inline-block;
  width: 32px;
  height: 2px;
  background: var(--wp-brand);
  border-radius: 2px;
}

/* Focus rings — accessible, brand-coloured */
*:focus-visible {
  outline: 2px solid var(--wp-brand);
  outline-offset: 3px;
  border-radius: 4px;
}
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

/* Smooth nav underline hover */
.wp-nav-link {
  position: relative;
  transition: color .15s ease;
}
.wp-nav-link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1.5px;
  background: var(--wp-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.wp-nav-link:hover::after, .wp-nav-link.active::after { transform: scaleX(1); }

/* Alpine x-cloak — hide un-hydrated state */
[x-cloak] { display: none !important; }

/* Toast entry */
@keyframes wpToastIn {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.wp-toast { animation: wpToastIn .25s ease-out; }

/* Skeleton shimmer */
@keyframes wpShimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.wp-skeleton {
  background: linear-gradient(90deg, var(--wp-surface) 0%, #EEF2F7 50%, var(--wp-surface) 100%);
  background-size: 200% 100%;
  animation: wpShimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}

/* Light-mode scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--wp-line); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #C9CFD6; }

::selection { background: rgba(27, 77, 62, 0.18); color: var(--wp-ink); }

/* Hide scrollbar utility */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* Print */
@media print {
  .wp-no-print { display: none !important; }
  body { background: white; color: black; }
}

/* ──────────────────────────────────────────────────────────────
   Task row interactions — smooth, optimistic, no reload
   ────────────────────────────────────────────────────────────── */

.wp-task-row {
  transition: opacity 0.2s ease;
}
.wp-task-row[data-removing="true"] {
  opacity: 0;
  transform: translateX(6px);
}

/* The check/empty circle at the start of a task row */
.wp-task-check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--wp-line2);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
  flex-shrink: 0;
  padding: 0;
}
.wp-task-check:hover { border-color: var(--wp-brand); }
.wp-task-check .wp-check-icon {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s ease 0.05s, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wp-task-row.is-done .wp-task-check {
  background: var(--wp-success);
  border-color: var(--wp-success);
}
.wp-task-row.is-done .wp-task-check .wp-check-icon {
  opacity: 1;
  transform: scale(1);
}

/* Task title — strikethrough animates in from the left */
.wp-task-title {
  position: relative;
  display: inline-block;
  transition: color 0.25s ease;
}
.wp-task-title::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1);
}
.wp-task-row.is-done .wp-task-title {
  color: var(--wp-muted);
}
.wp-task-row.is-done .wp-task-title::after {
  transform: scaleX(1);
}

/* ──────────────────────────────────────────────────────────────
   Empty states — teach the feature, show a ghost preview
   ────────────────────────────────────────────────────────────── */
.wp-empty-sample {
  position: relative;
  border: 1px dashed var(--wp-line);
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.4), rgba(247, 249, 252, 0));
}
.wp-empty-sample-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.9) 90%);
  pointer-events: none;
  border-radius: 10px;
}

/* ──────────────────────────────────────────────────────────────
   Hover state upgrades — secondary info reveals
   ────────────────────────────────────────────────────────────── */
.wp-row-hover-reveal {
  transition: background 0.12s ease, border-color 0.12s ease;
  position: relative;
}
.wp-row-hover-reveal:hover {
  background: rgba(27, 77, 62, 0.035);
}
.wp-row-hover-reveal .wp-row-action {
  opacity: 0;
  transition: opacity 0.12s ease;
}
.wp-row-hover-reveal:hover .wp-row-action {
  opacity: 1;
}

/* Card hover gets a subtle lift + brand-tinted border, no box-shadow theatrics */
.wp-card-hover {
  transition: border-color 0.15s ease, background 0.15s ease;
}
.wp-card-hover:hover {
  border-color: var(--wp-brand);
  background: rgba(27, 77, 62, 0.015);
}

/* ──────────────────────────────────────────────────────────────
   HTMX indicator — a subtle top progress bar on any request > 150ms
   ────────────────────────────────────────────────────────────── */
.htmx-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--wp-brand);
  transform-origin: left;
  transform: scaleX(0);
  opacity: 0;
  z-index: 100;
  pointer-events: none;
}
.htmx-request .htmx-indicator,
.htmx-indicator.htmx-request {
  opacity: 1;
  transform: scaleX(0.8);
  transition: transform 1.2s cubic-bezier(0.1, 0.7, 0.2, 1), opacity 0.15s;
}
.htmx-request.htmx-settling .htmx-indicator,
.htmx-indicator.htmx-request.htmx-settling {
  transform: scaleX(1);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.25s ease;
}

/* Pulse for stat cards that are actively updating */
@keyframes wpSoftPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.wp-pulse { animation: wpSoftPulse 1.4s ease-in-out infinite; }
