/* Stili propri delle pagine di Call Test, sopra la cornice e i token di shell.css. */

/* Codice di abbinamento: va letto da un metro di distanza mentre si digita sul tablet. */
.pairing-code {
  font-family: var(--bs-font-monospace);
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 0.5rem;
}

/* QR di abbinamento: lo legge la fotocamera del tablet puntata sullo schermo del PC. Sfondo bianco
   esplicito (anche con un eventuale tema scuro) perché gli scanner vogliono moduli scuri su chiaro;
   ~260 px bastano a mettere a fuoco da 30-50 cm. La quiet zone è già dentro l'SVG. */
/* Stesso stile per il QR della pagina Download, che il tablet apre nel browser. */
.pairing-qr, .download-qr {
  display: inline-block;
  width: 260px;
  height: 260px;
  background-color: #fff;
}

.pairing-qr svg, .download-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Celle presente/assente delle griglie dei codec. */
.cell-present {
  background-color: var(--success-soft) !important;
  color: var(--success);
}

.cell-absent {
  background-color: var(--danger-soft) !important;
  color: var(--danger);
}

.summary-grid td code {
  font-size: 0.8rem;
}

/* SHA-256 in tabella: si vede l'inizio, ma selezione e copia prendono l'hash intero. */
.sha-short {
  display: inline-block;
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.release-notes {
  white-space: pre-line;
}

/* Griglia video della sessione: riquadri 16:9 con la didascalia (name del partecipante) sotto. */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.video-tile {
  margin: 0;
}

.video-box {
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-tile figcaption {
  text-align: center;
  font-size: 0.9rem;
  padding-top: 0.25rem;
}

.stats-table td {
  white-space: nowrap;
}

/* Verdetti dell'esito (superato / attenzione / non superato): gli stessi colori tenui delle griglie
   dei codec, così la tabella fase × criterio si legge a colpo d'occhio anche stampata. */
.verdict-pass {
  background-color: var(--success-soft) !important;
}

.verdict-warn {
  background-color: var(--warning-soft) !important;
}

.verdict-fail {
  background-color: var(--danger-soft) !important;
  color: var(--danger);
}

.outcome-grid td, .outcome-grid th {
  white-space: nowrap;
}

/* Matrice di compatibilità dell'esito e del confronto fra dispositivi */
.compat-matrix td, .compat-matrix th {
  white-space: nowrap;
}

.compat-matrix td[title] {
  cursor: help;
}

.compat-recommended {
  font-weight: 700;
}

.summary-box .fs-6 {
  line-height: 1.35;
}

/* Riquadri dell'esito: fondo tenue del verdetto e una barra a sinistra del colore pieno, così il
   verdetto si legge da lontano anche col tema scuro. */
.summary-box {
  border-left-width: 4px;
}

.summary-box.verdict-pass { border-left-color: var(--success); }
.summary-box.verdict-warn { border-left-color: var(--warning); }
.summary-box.verdict-fail { border-left-color: var(--danger); }

.summary-box.verdict-fail, .summary-box.verdict-fail .text-body-secondary {
  color: var(--text-strong) !important;
}

#outcome-details > summary {
  cursor: pointer;
}

/* Flussi ricevuti dell'esito: i flussi regolari più tenui; col filtro attivo (default) si vedono
   solo quelli con problemi, e la riga "nessun flusso con problemi" solo se non ce ne sono. */
.received-flows tr.flow-ok > td {
  color: var(--bs-secondary-color);
}

.received-flows.flows-problems-only tr[data-flow-problem="false"],
.received-flows:not(.flows-problems-only) tr.flows-none {
  display: none;
}

/* Confronto fra dispositivi: classifica (una riga per tablet) e matrice girata (righe = criteri,
   colonne = tablet). La prima colonna resta ferma quando la tabella scorre in orizzontale; nella
   matrice girata anche le intestazioni dei tablet restano ferme in alto. */
.ranking-table td, .ranking-table th, .pivot-table td, .pivot-table th {
  white-space: nowrap;
}

.ranking-table td[title], .pivot-table td[title] {
  cursor: help;
}

.ranking-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.ranking-table th.sortable::after {
  content: " ↕";
  color: var(--bs-secondary-color);
  font-weight: normal;
}

.ranking-table th[aria-sort="descending"]::after {
  content: " ↓";
  color: inherit;
}

.ranking-table th[aria-sort="ascending"]::after {
  content: " ↑";
  color: inherit;
}

.ranking-table {
  font-size: 0.875rem;
}

/* Le colonne di testo vanno a capo, così la tabella sta in larghezza; le icone no. */
.ranking-table td.ranking-wrap {
  white-space: normal;
  min-width: 6rem;
}

.ranking-table .ranking-outcome {
  white-space: normal;
  min-width: 15rem;
}

.ranking-table .sticky-col, .pivot-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: inset -1px 0 0 var(--bs-border-color);
}

.ranking-table thead .sticky-col {
  z-index: 2;
}

.ranking-highlight > * {
  --bs-table-bg: var(--accent-soft);
  --bs-table-bg-type: var(--accent-soft) !important;
}

.pivot-wrap {
  max-height: 75vh;
  overflow: auto;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius-md);
}

/* Bordi separati: con i bordi collassati quelli delle celle sticky non le seguono e fra intestazione
   e bordo del riquadro si intravedono le righe che scorrono sotto. Ogni cella disegna il suo bordo
   destro e inferiore, il riquadro fa da bordo esterno. */
.pivot-table {
  width: auto;
  border-collapse: separate;
  border-spacing: 0;
}

.pivot-table > :not(caption) > * {
  border-width: 0;
}

.pivot-table > :not(caption) > * > * {
  border-width: 0 1px 1px 0;
}

.pivot-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: none;
}

.pivot-table thead th.sticky-col {
  z-index: 3;
}

/* Colonne dei tablet strette: il nome va a capo, le celle hanno solo l'icona. */
.pivot-table th.pivot-device {
  white-space: normal;
  overflow-wrap: anywhere;
  width: 5.5rem;
  min-width: 4rem;
  max-width: 5.5rem;
  font-size: 0.8rem;
  vertical-align: bottom;
  line-height: 1.15;
}

.pivot-table td {
  padding: 0.15rem 0.3rem;
}

.pivot-table .pivot-codec-start > * {
  border-top: 2px solid var(--bs-secondary-color);
}

.pivot-table tbody tr:first-child > * {
  border-top-width: 0;
}

.pivot-table .pivot-differ > * {
  --bs-table-bg: var(--accent-soft);
  --bs-table-bg-type: var(--accent-soft) !important;
}

/* Avviso «piano in corso: un deploy ora lo interrompe» (layout): nel piè di pagina in evidenza accanto
   alla versione, senza andare a capo (il piè di pagina è alto una riga). */
.plan-warning-footer {
  color: var(--bs-warning-text-emphasis);
  font-weight: 600;
}

/* Etichette dei verdetti (legenda, dettagli per fase): testo del colore del verdetto, leggibile anche
   col tema scuro (le pagine le marcano text-dark per lo sfondo chiaro). */
.badge.verdict-pass { color: var(--success) !important; }
.badge.verdict-warn { color: var(--warning) !important; }
.badge.verdict-fail { color: var(--danger) !important; }

/* I link nelle tabelle senza sottolineatura (come i datatable della CTA), sottolineati al passaggio. */
.table a:not(.btn) { text-decoration: none; font-weight: 600; }
.table a:not(.btn):hover { text-decoration: underline; }

/* Numeri allineati in colonna: cifre di larghezza fissa nelle tabelle. */
.table { font-variant-numeric: tabular-nums; }
.table td.text-end { white-space: nowrap; }

/* Codici brevi (stanza, versioni) nelle tabelle su una riga sola, anche sul telefono. */
.table code { white-space: nowrap; overflow-wrap: normal; }

/* Celle colorate (presente/assente, verdetti) dentro le tabelle: Bootstrap dipinge lo sfondo delle righe
   alterne e del passaggio del mouse con un'ombra interna sopra il background della cella, che
   coprirebbe il verde e il rosso sulle righe pari. Su queste celle l'ombra non c'è. */
.table > :not(caption) > * > .cell-present,
.table > :not(caption) > * > .cell-absent,
.table > :not(caption) > * > .verdict-pass,
.table > :not(caption) > * > .verdict-warn,
.table > :not(caption) > * > .verdict-fail {
  box-shadow: none !important;
}

/* Tablet nella stanza ma senza video (pagina della sessione, CallHealth). */
.call-warning { color: var(--bs-warning-text-emphasis); }
