/* tangotracker's own additions on top of trackerui.
 *
 * Only what the shared package cannot know about: the video player, the
 * thumbnail placeholders, and the two-column detail layout. Everything else
 * -- palette, type, cards, badges, tags -- comes from trackerui.
 */

/* ---- Header status counters ------------------------------------------- */

.stat-link { border-bottom: 1px solid transparent; padding-bottom: 1px;
  transition: color 140ms ease, border-color 140ms ease; }
.stat-link:hover { color: var(--text); border-bottom-color: currentColor; }
.stat-link.ok:hover   { color: var(--ok); }
.stat-link.warn:hover { color: var(--warn); }
.stat-link.bad:hover  { color: var(--danger); }

/* ---- Organized/linked/orphan progress bar ----------------------------- */

.progress { display: flex; height: 6px; border-radius: var(--radius-pill);
  overflow: hidden; margin: var(--s2) 0 var(--s5); background: var(--border); }
.progress i { display: block; }
.progress .ok   { background: var(--ok); }
.progress .warn { background: var(--warn); }
.progress .bad  { background: var(--danger); }

/* ---- Video tiles ------------------------------------------------------ */

/* Placeholder until thumbnails are generated: the filename on a dark field,
 * holding the same 16/9 box a real poster frame will occupy. */
.thumb {
  aspect-ratio: 16 / 9;
  background: #07070c;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s2);
  color: var(--faint); font-size: 0.72rem; text-align: center;
  word-break: break-all;
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }

/* Once the sprite sheet has loaded the filename label would sit on top of the
 * frames, so it is hidden and the image speaks for itself. */
.thumb.has-sprite { color: transparent; background-repeat: no-repeat; }

.tile-meta { padding: var(--s2) var(--s3) var(--s3); }
.tile-name { font-size: 0.85rem; word-break: break-word; }
.tile-sub { font-size: 0.72rem; color: var(--muted);
  margin-top: var(--s1); display: flex; gap: var(--s2); flex-wrap: wrap;
  align-items: center; }

/* ---- Player ----------------------------------------------------------- */

.player { background: #000; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: var(--s5); }
.player video { width: 100%; max-height: 65vh; display: block; }

/* ---- Detail layout ---------------------------------------------------- */

.cols { display: grid; gap: var(--s6);
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

.cols h1 { font-size: 1.5rem; margin-bottom: var(--s1); }
.cols aside th { width: 5.5rem; }

/* ---- Sign-in ----------------------------------------------------------- */

.signin { max-width: 26rem; margin: 12vh auto 0; text-align: center; }
.signin h1 { font-size: 2.2rem; margin-bottom: var(--s2); }
.signin .btn { margin-top: var(--s6); }
.signin-error {
  margin-top: var(--s4);
  padding: var(--s2) var(--s3);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.9rem;
}

/* Google's brand guidelines require its button stay white with dark text,
 * so this is the one control that opts out of the dark palette. */
.btn-google {
  background: #fff;
  color: #1f1f1f;
  border-color: #dadce0;
  text-transform: none;
  font-family: var(--font-body);
  letter-spacing: normal;
}
.btn-google:hover { background: #f8f9fa; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }

.user-email {
  color: var(--faint);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot form { margin: 0; }

/* ---- Search box ------------------------------------------------------- */

/* Lives in the top bar's slot, where the stat counters used to sit. The
 * counters moved into the facet chips on the library, which is the only page
 * that can act on them. */
.search { display: flex; }
.search input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  padding: var(--s1) var(--s3);
  width: 15rem;
  max-width: 40vw;
}
.search input::placeholder { color: var(--faint); }
.search input:focus {
  outline: none;
  border-color: var(--violet-bright);
}

/* ---- Facet chips ------------------------------------------------------ */

/* Every chip is a link to this page with one facet toggled, so the filter
 * state is entirely in the URL: no JS, and a narrowed view is shareable. */
.facets {
  display: flex; flex-wrap: wrap; gap: var(--s3);
  margin-bottom: var(--s5);
}
.facet-group { display: flex; flex-wrap: wrap; gap: var(--s1); }

.chip {
  display: inline-block;
  padding: 2px var(--s2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.chip:hover { border-color: var(--violet-bright); color: inherit; }

/* The active chip inverts rather than merely brightening, so which facets are
 * on is readable at a glance across three separate groups. */
.chip.on {
  background: var(--violet-bright); border-color: var(--violet-bright);
  color: #07070c;
}
.chip.ok.on     { background: var(--ok);     border-color: var(--ok); }
.chip.warn.on   { background: var(--warn);   border-color: var(--warn); }
.chip.bad.on    { background: var(--danger); border-color: var(--danger); }
.chip.accent.on { background: var(--violet-bright); border-color: var(--violet-bright); }

.matched-tags { margin-bottom: var(--s4); display: flex;
  flex-wrap: wrap; gap: var(--s1); align-items: center; }

.link-accent { color: var(--violet-bright); }
