/* ============================================================
   recommandation.css — Algorithmes de recommandation
   ============================================================ */

/* ── Boucle rétroaction ── */
.rec-loop-wrap {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* ── Deux colonnes ── */
.rec-two-cols {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rec-col-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.rec-col-title {
  font-family: var(--ss-font-mono);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  padding: 0.5rem;
  border-radius: 8px;
}

.rec-col-title--belief {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.rec-col-title--reality {
  background: rgba(244, 63, 94, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.rec-vs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}
.rec-vs-row.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.rec-vs-cell {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: var(--ss-font-mono);
  font-size: 0.92rem;
  line-height: 1.5;
}

.rec-vs-cell--belief {
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

.rec-vs-cell--reality {
  background: rgba(244, 63, 94, 0.07);
  border: 1px solid rgba(244, 63, 94, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

/* ── Chiffres ── */
.rec-stats-wrap {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rec-stat-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}
.rec-stat-row.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.rec-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.rec-stat-label {
  font-family: var(--ss-font-mono);
  font-size: 1rem;
  color: var(--ss-text);
  font-weight: 600;
}

.rec-stat-value {
  font-family: var(--ss-font-mono);
  font-size: 1.4rem;
  font-weight: 700;
}

.rec-stat-track {
  height: 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  overflow: hidden;
}

.rec-stat-fill {
  height: 100%;
  border-radius: 7px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.rec-stat-sub {
  font-family: var(--ss-font-mono);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.3);
}

/* ── Dérives ── */
.rec-risks-wrap {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rec-risk-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  opacity: 0;
  transform: translateX(12px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}
.rec-risk-card.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.rec-risk-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}

.rec-risk-title {
  font-family: var(--ss-font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fca5a5;
  margin-bottom: 0.3rem;
}

.rec-risk-desc {
  font-size: 0.9rem;
  color: var(--ss-muted);
  line-height: 1.55;
}

/* ── Checklist ── */
.rec-checklist-wrap {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rec-check-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    background 0.25s ease;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}
.rec-check-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.rec-check-item.is-checked {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.rec-check-box {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    border-color 0.25s ease,
    background 0.25s ease;
}
.rec-check-item.is-checked .rec-check-box {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.2);
}
.rec-check-box .material-icons-round {
  font-size: 16px;
  color: #10b981;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.rec-check-item.is-checked .rec-check-box .material-icons-round {
  opacity: 1;
}

.rec-check-text {
  flex: 1;
  font-size: 0.92rem;
  color: var(--ss-muted);
  line-height: 1.4;
  transition: color 0.25s ease;
}
.rec-check-item.is-checked .rec-check-text {
  color: var(--ss-text);
}

/* ── SVG D3 ── */
.rec-svg {
  width: 100%;
  height: 420px;
  overflow: visible;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .rec-col-header,
  .rec-vs-row {
    grid-template-columns: 1fr;
  }
  .rec-stats-wrap {
    display: none;
  }
}
