/* Custom styles for Report Annotator (client-side) */

/* Custom easing curves */
:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Focus states for accessibility */
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Button press feedback — every pressable element feels responsive */
button,
label.cursor-pointer,
.drop-zone {
  transition: transform 160ms var(--ease-out);
}

button:active,
label.cursor-pointer:active {
  transform: scale(0.985);
}

/* Sentence selection highlight animation */
@media (hover: hover) and (pointer: fine) {
  [data-sentence-idx]:hover {
    transform: translateX(2px);
    transition: transform 80ms var(--ease-out);
  }
}

/* Selected sentence: outline renders outside the box model — no layout shift.
   Negative offset pulls it inward so it won't overlap adjacent sentence highlights. */
.sentence-selected {
  outline: 2px solid #3b82f6;
  outline-offset: 0px;
  border-radius: 3px;
}

/* Sentence spans: extend hover target to fill inter-line gaps without changing line spacing */
[data-sentence-idx] {
  padding-block: 3px;
  margin-block: -3px;
}

/* Hover highlight transition — gated to pointer devices only */
@media (hover: hover) and (pointer: fine) {
  [data-sentence-idx] {
    transition: background-color 100ms ease-out, box-shadow 100ms ease-out !important;
  }
}

/* Keyboard shortcut hints */
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
}

/* Details/summary styling */
details summary {
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 300;
  transition: transform 200ms ease-out;
}

details[open] summary::before {
  transform: rotate(45deg);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Reduced motion: keep opacity/color fades, suppress transform-based motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  /* Allow opacity and color transitions (aid comprehension) */
  * {
    transition-property: opacity, color, background-color, border-color !important;
    transition-duration: 200ms !important;
  }
}

/* Autocomplete dropdown */
.autocomplete-results {
  transition: opacity 150ms ease-out;
}

.autocomplete-results.hidden {
  opacity: 0;
  pointer-events: none;
}

.autocomplete-results:not(.hidden) {
  opacity: 1;
}

/* Autocomplete option hover state */
.finding-option {
  border-bottom: 1px solid #f3f4f6;
}

.finding-option:last-child {
  border-bottom: none;
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 150ms ease-out;
}

/* Drop zone: smooth border/bg transition on drag-over */
.drop-zone {
  transition: transform 160ms var(--ease-out), border-color 150ms ease-out, background-color 150ms ease-out;
}

.drop-zone-active {
  border-color: #3b82f6 !important;
  background-color: #eff6ff !important;
}
