/* Mirrors src/styles.css base layer + TrioPrep animations. */
* { border-color: var(--color-border); }

body {
  background-color: var(--color-background);
  color: var(--color-foreground);
  font-family: "Quicksand", ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "ss01";
  margin: 0;
}

h1, h2, h3, h4 {
  font-family: "Quicksand", ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}

@keyframes trio-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes trio-fade-in-soft {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes trio-pop-in {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes trio-spin-slow { to { transform: rotate(360deg); } }

.trio-fade-in { animation: trio-fade-in 0.5s ease-out both; }
.trio-fade-in-soft { animation: trio-fade-in-soft 0.6s ease-out both; }
.trio-pop-in { animation: trio-pop-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
.trio-stagger > * { animation: trio-fade-in 0.5s ease-out both; }
.trio-stagger > *:nth-child(1) { animation-delay: 0.02s; }
.trio-stagger > *:nth-child(2) { animation-delay: 0.06s; }
.trio-stagger > *:nth-child(3) { animation-delay: 0.10s; }
.trio-stagger > *:nth-child(4) { animation-delay: 0.14s; }
.trio-stagger > *:nth-child(5) { animation-delay: 0.18s; }
.trio-stagger > *:nth-child(6) { animation-delay: 0.22s; }
.trio-stagger > *:nth-child(7) { animation-delay: 0.26s; }
.trio-stagger > *:nth-child(8) { animation-delay: 0.30s; }
.trio-stagger > *:nth-child(9) { animation-delay: 0.34s; }
.trio-stagger > *:nth-child(10) { animation-delay: 0.38s; }

/* shadcn-equivalent primitives, hand-ported so markup stays 1:1 with the React app */
.tp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  white-space: nowrap; border-radius: .625rem; font-size: .875rem; font-weight: 500;
  transition: background-color .2s, color .2s, border-color .2s, opacity .2s, transform .2s;
  height: 2.25rem; padding: 0 1rem; cursor: pointer; border: 1px solid transparent;
  background: var(--color-primary); color: var(--color-primary-foreground);
}
.tp-btn:hover { background: color-mix(in oklab, var(--color-primary) 90%, transparent); }
.tp-btn:disabled { opacity: .5; pointer-events: none; }
.tp-btn-outline { background: var(--color-background); color: var(--color-foreground); border-color: var(--color-input); }
.tp-btn-outline:hover { background: var(--color-accent); color: var(--color-accent-foreground); }
.tp-btn-ghost { background: transparent; color: var(--color-foreground); }
.tp-btn-ghost:hover { background: var(--color-accent); color: var(--color-accent-foreground); }
.tp-btn-destructive { background: var(--color-destructive); color: var(--color-destructive-foreground); }
.tp-btn-sm { height: 2rem; padding: 0 .75rem; font-size: .8125rem; }
.tp-btn-lg { height: 2.5rem; padding: 0 1.5rem; }

.tp-input {
  display: flex; width: 100%; height: 2.25rem; border-radius: .625rem;
  border: 1px solid var(--color-input); background: transparent;
  padding: .25rem .75rem; font-size: .875rem; color: var(--color-foreground);
  outline: none; transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.tp-input::placeholder { color: var(--color-muted-foreground); }
.tp-input:focus-visible { border-color: var(--color-ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-ring) 40%, transparent); }
.tp-input:disabled { opacity: .5; cursor: not-allowed; }
textarea.tp-input { height: auto; min-height: 4rem; padding: .5rem .75rem; resize: vertical; }
select.tp-input { cursor: pointer; }

.tp-label { font-size: .875rem; font-weight: 500; line-height: 1; display: block; }

.tp-check {
  appearance: none; height: 1rem; width: 1rem; flex: none; border-radius: .25rem;
  border: 1px solid var(--color-input); background: var(--color-background); cursor: pointer;
  display: inline-grid; place-content: center; transition: background-color .15s, border-color .15s;
}
.tp-check:checked { background: var(--color-primary); border-color: var(--color-primary); }
.tp-check:checked::after {
  content: ""; width: .55rem; height: .3rem; border-left: 2px solid var(--color-primary-foreground);
  border-bottom: 2px solid var(--color-primary-foreground); transform: rotate(-45deg) translateY(-1px);
}

.tp-dialog-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgb(0 0 0 / .5);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: trio-fade-in-soft .2s ease-out both;
}
.tp-dialog {
  background: var(--color-background); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);
  width: 100%; display: flex; flex-direction: column; overflow: hidden;
  animation: trio-pop-in .2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* katex should inherit the surrounding size */
.katex { font-size: 1.05em; }

[data-lucide] { display: inline-flex; }

/* ---- imported College Board question banks ------------------------------ */
/* Math: stems, choices and some rationale formulas are exact crops of the
   source PDFs (MathJax drew them as vector art with no text layer).
   Reading & Writing: only the data tables and charts are crops, because their
   meaning lives in the layout. All crops carry a real alpha channel, so they
   sit on the page background with no white box. */
.qb-stem,
.qb-choice {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}
/* A figure travelling inside the prompt gets the same bordered card as
   TP.qFigure, so every table/diagram sits in a box. */
.qb-stem {
  padding: .75rem .875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  margin: .75rem auto;
}
.qb-inline {
  display: inline-block;
  vertical-align: -0.25em;
  margin: 0 1px;
  image-rendering: -webkit-optimize-contrast;
}
/* A crop is sized from its own ink, so it can be taller than the line box.
   Nothing in the question column may clip it. */
.qb-stem, .qb-choice, .qb-inline, .qb-block { overflow: visible; }
/* A centred equation printed on its own line in the source. */
.qb-block {
  display: block;
  margin: .6rem auto;
  max-width: 100%;
  image-rendering: -webkit-optimize-contrast;
}
/* Keeps a trailing comma or period from wrapping away from its formula. */
.qb-nb { white-space: nowrap; }
/* Segment notation: the bar the source prints over two point names. */
.qb-seg { text-decoration: overline; }
.qb-figure {
  display: block;
  padding: .75rem .875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  overflow-x: auto;
}
.qb-fig-img {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
