/* Checkilo — supplementary CSS (animations + a11y helpers + prose).
   Most styling is via Tailwind utilities; this file is for what utilities can't express. */

/* ── Flash message animations ───────────────────────────────────────────── */
@keyframes flash-slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes flash-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.flash-enter { animation: flash-slide-in 0.3s ease-out; }
.flash-exit  { animation: flash-fade-out 0.3s ease-out forwards; }

/* ── Status pulse — for live "in progress" indicators ──────────────────── */
@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
.status-pulse { animation: status-pulse 2s ease-in-out infinite; }

/* ── Skeleton shimmer — for loading-state placeholders ─────────────────── */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #F1F5F9 0%, #E2E8F0 50%, #F1F5F9 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
}

/* ── Copy confirmation micro-interaction ───────────────────────────────── */
@keyframes copy-confirm-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.035); }
  100% { transform: scale(1); }
}
.copy-button {
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
  touch-action: manipulation;
}
.copy-button.copy-confirmed {
  border-color: #34D399;
  background: #ECFDF5;
  color: #065F46;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .22);
  animation: copy-confirm-pop 180ms ease-out;
}
.copy-button.copy-confirmed svg { color: #059669; }
.copy-button.copy-failed {
  border-color: #FCA5A5;
  background: #FEF2F2;
  color: #991B1B;
}
.dashboard-click-row {
  cursor: pointer;
  outline: none;
}
.dashboard-click-row:focus-visible {
  box-shadow: inset 3px 0 0 #2563EB;
  background: #F8FAFC;
}

/* ── Form choice cards — boolean/auth and channel pickers ─────────────── */
.choice-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  min-height: 4.25rem;
  padding: 0.875rem;
  border: 1px solid #E2E8F0;
  border-radius: 0.75rem;
  background: #FFFFFF;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.choice-card:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}
.choice-card:has(input:checked) {
  border-color: #2563EB;
  background: #EFF6FF;
  box-shadow: inset 0 0 0 1px #2563EB;
}
.choice-card:has(input:focus-visible) {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}
.choice-indicator {
  position: relative;
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.125rem;
  border: 2px solid #CBD5E1;
  border-radius: 999px;
  background: #FFFFFF;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.choice-indicator-checkbox {
  border-radius: 0.375rem;
}
.choice-card:has(input:checked) .choice-indicator {
  border-color: #2563EB;
  background: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
}
.choice-card:has(input[type="radio"]:checked) .choice-indicator::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: #FFFFFF;
}
.choice-card:has(input[type="checkbox"]:checked) .choice-indicator::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ── Reduced motion: disable every animation defined here ──────────────── */
@media (prefers-reduced-motion: reduce) {
  .flash-enter, .flash-exit, .status-pulse, .skeleton, .copy-button.copy-confirmed { animation: none; }
  .copy-button, .choice-card, .choice-indicator { transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease; }
}

/* ── Mobile bottom-bar safe-area-inset on iPhone home-indicator ────────── */
.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ── Click-to-select for ping URLs ─────────────────────────────────────── */
.select-all-text { user-select: all; cursor: pointer; }

/* ── Skip-to-main-content link (visible only when keyboard-focused) ────── */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: #1E293B; color: #fff; padding: 10px 14px; border-radius: 6px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ── Focus ring — used everywhere via the .focus-ring helper ───────────── */
.focus-ring:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}

/* ── Mono helper (some inline contexts can't use Tailwind's font-mono) ── */
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ── Inner card surface for nested content (ping-URL block, runbook box) ─ */
.surface-soft { background: #F8FAFC; border: 1px solid #E2E8F0; }

/* ── Markdown article styling (used by /help/{slug} body_html) ─────────── */
.prose-help h1 { font-size: 1.75rem; font-weight: 700; color: #1E293B; margin: 0 0 .5rem; letter-spacing: -0.01em; }
.prose-help h2 { font-size: 1.25rem; font-weight: 600; color: #1E293B; margin: 2rem 0 .75rem; }
.prose-help h3 { font-size: 1rem;    font-weight: 600; color: #1E293B; margin: 1.5rem 0 .5rem; }
.prose-help p, .prose-help li { color: #1E293B; line-height: 1.7; }
.prose-help p { margin: 0 0 1rem; }
.prose-help ul { list-style: disc;    padding-left: 1.25rem; margin: 0 0 1rem; }
.prose-help ol { list-style: decimal; padding-left: 1.25rem; margin: 0 0 1rem; }
.prose-help code {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.875rem;
  background: #F1F5F9; color: #1E293B; padding: 1px 6px; border-radius: 4px; border: 1px solid #E2E8F0;
}
.prose-help pre {
  background: #0F172A; color: #E2E8F0; padding: 1rem 1.25rem; border-radius: 8px;
  overflow-x: auto; margin: 0 0 1rem;
}
.prose-help pre code { background: transparent; color: inherit; padding: 0; border: 0; font-size: .9rem; }
.prose-help blockquote {
  border-left: 3px solid #DBEAFE; padding-left: 1rem; color: #475569;
  font-style: italic; margin: 0 0 1rem;
}
.prose-help a {
  color: #2563EB; text-decoration: underline;
  text-decoration-color: #DBEAFE; text-underline-offset: 3px;
}
.prose-help a:hover { text-decoration-color: #2563EB; }
.prose-help img { max-width: 100%; border-radius: 8px; border: 1px solid #E2E8F0; }
.prose-help img.broken {
  background: #F8FAFC; padding: 2rem; text-align: center; color: #64748B;
  border: 1px dashed #CBD5E1; font-size: .875rem;
}

/* ── Hide scrollbars on tab strips while keeping keyboard scrollability ── */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }
