@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  body {
    font-family: Inter, system-ui, sans-serif;
  }
  h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
  }
}

@layer utilities {
  .pt-safe { padding-top: env(safe-area-inset-top); }
  .pb-safe { padding-bottom: env(safe-area-inset-bottom); }
  .pl-safe { padding-left: env(safe-area-inset-left); }
  .pr-safe { padding-right: env(safe-area-inset-right); }
}

/* Select mode (PC-130). body[data-select-active] is set by
   library_select_controller while Select mode is on: the batch action
   bar replaces the bottom tab bar, row checkboxes are revealed, and
   selected rows get the amber left-border + tint treatment. The
   attribute is removed entirely when inactive. No slide animation —
   the bar appears/disappears instantly (prefers-reduced-motion safe). */
.bf-batch-action-bar { display: none; }
body[data-select-active] .bf-batch-action-bar { display: block; }
body[data-select-active] [data-test-id="bottom-tab-bar"] { display: none; }

.bf-select-checkbox { display: none; }
[data-select-active] .bf-select-checkbox { display: block; }

[data-select-active] [data-book-row][data-selected="true"] {
  border-left: 2px solid #854F0B; /* bf-amber */
  background-color: rgba(133, 79, 11, 0.08);
}

@keyframes bf-sheet-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes bf-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes bf-slide-in-from-right {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .bf-anim-sheet-slide-up      { animation: bf-sheet-slide-up 220ms cubic-bezier(0.32, 0.72, 0, 1); }
  .bf-anim-fade-in             { animation: bf-fade-in 160ms ease-out; }
  .bf-anim-slide-in-from-right { animation: bf-slide-in-from-right 220ms cubic-bezier(0.32, 0.72, 0, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .bf-anim-sheet-slide-up,
  .bf-anim-fade-in,
  .bf-anim-slide-in-from-right { animation: bf-fade-in 120ms ease-out; }
}

/* PC-185 (folds in PC-152): barcode scanning is a phone feature (rear,
   autofocus camera). On pointer-fine devices the front webcam can't focus
   on a barcode, so hide every scan affordance and show an explanatory note.
   Plain classes so they always compile regardless of content scanning. */
.scan-affordance { display: none; }
.scan-desktop-note { display: block; }

@media (pointer: coarse) {
  .scan-affordance { display: flex; }
  .scan-desktop-note { display: none; }
}
