/* ColloquiTeam · colloquio.css
   Stili specifici della vista Colloquio: confronto auto vs val,
   tabelle comparative, blocchi testi sezioni libere, radar chart. */

:root {
  --auto-color: #3B82F6;   /* blu — Autovalutazione utente */
  --val-color:  #C26A4B;   /* terracotta — Valutazione responsabile */
  --target-color: #3D6B52; /* sage — Obiettivo di crescita (opzionale) */
}

/* ── Legenda colori dataset ── */
.colloquio-legend {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 22px;
  padding: 12px 18px;
  background: var(--paper);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}
.colloquio-legend .lg-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.colloquio-legend .lg-swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.colloquio-legend .lg-swatch.auto     { background: var(--auto-color); }
.colloquio-legend .lg-swatch.val      { background: var(--val-color); }
.colloquio-legend .lg-swatch.expected { background: var(--target-color); }
.colloquio-legend .lg-warning {
  font-size: 12px;
  color: var(--accent);
  margin-left: auto;
  font-style: italic;
}

/* ── Card di sezione comparativa ── */
.compare-section {
  background: white;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 22px;
}
.compare-section .section-head { margin-bottom: 16px; }

/* ── Tabella confronto rating ── */
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
.compare-table thead th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-mute);
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1.5px solid var(--rule-soft);
}
.compare-table thead th:first-child { text-align: left; padding-left: 4px; }
.compare-table thead th.col-auto { color: var(--auto-color); }
.compare-table thead th.col-val  { color: var(--val-color); }
.compare-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
}
.compare-table tbody tr:last-child td { border-bottom: none; }

/* Righe con delta ≠ 0: evidenziate in maniera non invasiva.
   Tonalità più tenue per |delta|=1, più visibile per |delta|≥2. */
.compare-table tbody tr.row-diverge td {
  background: rgba(194, 106, 75, 0.05);
}
.compare-table tbody tr.row-diverge-high td {
  background: rgba(194, 106, 75, 0.10);
}
.compare-table tbody tr.row-diverge td:first-child {
  border-left: 2px solid transparent;
}
.compare-table tbody tr.row-diverge-small td:first-child {
  border-left-color: var(--amber);
}
.compare-table tbody tr.row-diverge-high td:first-child {
  border-left-color: var(--accent);
}
.compare-table tbody td:first-child {
  color: var(--ink);
  font-weight: 500;
  padding-left: 4px;
  padding-right: 12px;
}

/* Cella livello rating */
.rating-pill {
  display: inline-block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: .03em;
  color: white;
}
.rating-pill.empty {
  background: transparent;
  color: var(--ink-mute);
  border: 1px dashed var(--rule-soft);
  font-style: italic;
  font-weight: 500;
}
.rating-pill.r1 { background: var(--rating-1); }
.rating-pill.r2 { background: var(--rating-2); }
.rating-pill.r3 { background: var(--rating-3); }
.rating-pill.r4 { background: var(--rating-4); }
.rating-pill.r5 { background: var(--rating-5); }

.compare-table .col-auto-cell,
.compare-table .col-val-cell { text-align: center; }

/* Delta */
.delta-cell {
  text-align: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-mute);
  width: 60px;
}
.delta-cell.aligned  { color: var(--sage); }     /* delta 0 */
.delta-cell.small    { color: var(--amber); }    /* |delta| = 1 */
.delta-cell.high     { color: var(--accent); }   /* |delta| >= 2 */

/* Box testi sezioni libere */
.free-text-block {
  margin-top: 14px;
}
.free-text-block .ft-label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 4px;
}
.free-text-block .ft-hint {
  display: block;
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
  margin-bottom: 6px;
}
.free-text-block .ft-content {
  background: var(--paper);
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--auto-color);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  min-height: 32px;
}
.free-text-block .ft-content.empty {
  color: var(--ink-mute);
  font-style: italic;
  border-left-color: var(--rule-soft);
}

/* ── Radar Chart wrapper ── */
.ruota-section {
  background: white;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: 26px 26px 30px;
  margin-bottom: 22px;
}
.ruota-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
}
.ruota-canvas-wrap {
  position: relative;
  width: 100%;
  height: 520px;
}
.ruota-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.ruota-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-row {
  background: var(--paper);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-row .stat-label {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-mute);
}
.stat-row .stat-value {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px;
  font-weight: 700;
}
.stat-row.auto     .stat-value { color: var(--auto-color); }
.stat-row.val      .stat-value { color: var(--val-color); }
.stat-row.expected .stat-value { color: var(--target-color); }
.stat-row.gap      .stat-value { color: var(--accent); }


/* ── Trigger interattivi (hover evidenzia il dataset nel radar) ── */
.colloquio-legend .lg-item.lg-interactive {
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  transition: all .15s ease;
  border: 1px solid transparent;
}
.colloquio-legend .lg-item.lg-interactive:hover,
.colloquio-legend .lg-item.lg-interactive.active {
  background: white;
  box-shadow: var(--shadow-sm);
}
.colloquio-legend .lg-item.lg-interactive .lg-swatch { transition: transform .15s ease; }
.colloquio-legend .lg-item.lg-interactive:hover .lg-swatch,
.colloquio-legend .lg-item.lg-interactive.active .lg-swatch { transform: scale(1.3); }

/* Stat-row laterali (Media auto/resp/obiettivo) */
.stat-row.stat-row-interactive {
  cursor: pointer;
  transition: all .15s ease;
  border: 1px solid transparent;
}
.stat-row.stat-row-interactive:hover,
.stat-row.stat-row-interactive.active {
  background: white;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.stat-row.stat-row-interactive.auto.active     { border-color: var(--auto-color); }
.stat-row.stat-row-interactive.val.active      { border-color: var(--val-color); }
.stat-row.stat-row-interactive.expected.active { border-color: var(--target-color); }
.stat-row.stat-row-interactive.gap.active      { border-color: var(--amber, #D97706); }

/* Lista divergenze */
.divergenze-box {
  background: var(--paper);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 18px;
}
.divergenze-box h4 {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}
.divergenze-box ul { list-style: none; padding: 0; margin: 0; }
.divergenze-box li {
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px dotted var(--rule-soft);
  line-height: 1.5;
}
.divergenze-box li:last-child { border-bottom: none; }
.divergenze-box li b { color: var(--ink); }
.divergenze-box li .auto-b { color: var(--auto-color); font-weight: 700; }
.divergenze-box li .val-b  { color: var(--val-color);  font-weight: 700; }
.divergenze-box li .delta-tag {
  display: inline-block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  margin-left: 8px;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: middle;
}
.divergenze-box li.aligned .delta-tag { background: var(--sage); }

@media (max-width: 900px) {
  .ruota-grid { grid-template-columns: 1fr; }
  .ruota-canvas-wrap { height: 380px; }
}
