/*
 *= require font-awesome
 *= require actiontext
 */

/* Chart.js custom styles */
.accuracy-chart {
  position: relative;
  margin: 1rem 0;
}

.accuracy-chart canvas {
  max-height: 100%;
}

.accuracy-chart-main {
  position: relative;
  height: 260px;
}

@media (min-width: 768px) {
  .accuracy-chart-main {
    height: 320px;
  }
}

/* Dynamic height for wristcheck stats chart */
.accuracy-chart div[data-controller="wristcheck-stats"] {
  min-height: 300px;
}

/* Dark mode scrollbars */
.dark * {
  scrollbar-color: #4b5563 #1f2937;
}

/* Disabled input/select styling */
input:disabled, select:disabled {
  background-color: var(--color-gray-100);
  opacity: 0.6;
  cursor: not-allowed;
}
.dark input:disabled, .dark select:disabled {
  background-color: var(--color-gray-700);
}

/* Sortable drag feedback */
.sortable-ghost {
  opacity: 0.35;
  filter: grayscale(0.5);
}

.sortable-ghost > * {
  visibility: visible;
}

.sortable-chosen {
  cursor: grabbing !important;
}

.sortable-fallback {
  opacity: 0.95 !important;
  transform: scale(1.03) rotate(-1deg);
  box-shadow:
    0 20px 35px -10px rgba(15, 23, 42, 0.35),
    0 8px 14px -6px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(59, 130, 246, 0.4);
  border-radius: 0.75rem;
  cursor: grabbing !important;
  transition: box-shadow 120ms ease-out;
}

.dark .sortable-fallback {
  box-shadow:
    0 22px 38px -10px rgba(0, 0, 0, 0.6),
    0 10px 16px -6px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(96, 165, 250, 0.55);
}


/* Monthly recap banner: one calm entrance (fade + slight rise), motion-safe. */
@media (prefers-reduced-motion: no-preference) {
  .recap-banner {
    animation: recap-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@keyframes recap-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Share-image modals (watch / monthly recap / SOTC) render via <dialog>.
   showModal() promotes the element to the browser top layer, positioned against
   the viewport, so it is immune to ancestor transforms (the old reason for the
   teleport-to-body) and to the iOS WebKit position:fixed scroll-offset bug that
   left a gap at the top of the modal — all with no positioning JS.

   The dialog itself acts as the full-viewport overlay that centers the card;
   sizing of the card lives in Tailwind on its child. */
.share-dialog {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: none;
  max-height: none;
}

.share-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
}

@media (min-width: 640px) {
  .share-dialog[open] {
    padding: 1rem;
  }
}

.share-dialog::backdrop {
  background-color: rgb(15 23 42 / 0.8); /* slate-900 / 80% */
}
