/* team_form_insights.css */

.hero.hero--tf {
  background: linear-gradient(to right, #1d4ed8, var(--primary-color));
  color: #fff;
}

/* Section filtres */

.tf-filters-section {
  padding-top: 32px;
  padding-bottom: 24px;
}

.tf-filters-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}

.tf-filters-header .section-title {
  margin-bottom: 4px;
}

.tf-filters-header .section-subtitle.small {
  font-size: 0.9rem;
  color: var(--muted-text, #6b7280);
}

.tf-sort-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.tf-sort-block .filter-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.tf-season-warning {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.tf-season-warning.hidden {
  display: none;
}

/* Grille principale */

.tf-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.tf-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Carte générique */

.tf-card {
  background: var(--card-bg, #ffffff);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.tf-card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.tf-card-header h2 {
  font-size: 1.15rem;
}

.tf-card-subtitle {
  font-size: 0.9rem;
  color: var(--muted-text, #6b7280);
}

/* Chips */

.tf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.tf-chip-league {
  background: #eff6ff;
  color: #1d4ed8;
}

.tf-chip-ok {
  background: #ecfdf3;
  color: #166534;
}

.tf-chip-warn {
  background: #fef3c7;
  color: #92400e;
}

/* Résumé ligue */

.tf-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: stretch;
}

.tf-summary-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tf-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tf-summary-label {
  font-size: 0.9rem;
  color: var(--muted-text, #6b7280);
}

.tf-summary-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.tf-summary-help {
  font-size: 0.8rem;
  color: var(--muted-text, #6b7280);
}

.tf-summary-flags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tf-summary-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tf-summary-team {
  padding: 8px 10px;
  border-radius: 12px;
  background: #f9fafb;
}

.tf-summary-team-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted-text, #6b7280);
  margin-bottom: 4px;
}

.tf-summary-team strong {
  display: block;
  margin-bottom: 4px;
}

.tf-summary-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted-text, #6b7280);
}

/* Barres */

.tf-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin-top: 4px;
}

.tf-bar.small {
  height: 6px;
}

.tf-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.tf-bar-positive {
  background: #22c55e;
}

.tf-bar-negative {
  background: #ef4444;
}

/* Team list */

.tf-team-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tf-team-row,
.tf-series-row,
.tf-summary-team {
  background: #ffffff; /* au lieu de #f9fafb */
  border: 1px solid #e5e7eb;
}

.tf-team-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f9fafb;
}

.tf-team-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tf-team-name {
  font-weight: 600;
  font-size: 0.98rem;
}

.tf-team-last {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tf-team-label {
  font-size: 0.78rem;
  color: var(--muted-text, #6b7280);
}

.tf-last-results {
  font-size: 0.9rem;
}

.tf-team-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tf-team-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tf-team-value {
  font-size: 0.95rem;
  font-weight: 500;
}

.tf-team-value.pos {
  color: #16a34a;
}

.tf-team-value.neg {
  color: #b91c1c;
}

.tf-team-streak {
  font-size: 0.88rem;
}

.tf-team-trend {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  font-size: 0.85rem;
}

.tf-team-trend-label {
  font-size: 0.78rem;
  color: var(--muted-text, #6b7280);
}

.tf-team-trend-value {
  font-weight: 500;
}

/* Séries */

.tf-series-block {
  margin-top: 8px;
}

.tf-series-block h3 {
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.tf-series-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tf-series-row {
  padding: 8px 10px;
  border-radius: 12px;
  background: #f9fafb;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr);
  gap: 10px;
}

.tf-series-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tf-series-header {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.95rem;
}

.tf-series-vs {
  font-size: 0.8rem;
  color: var(--muted-text, #6b7280);
}

.tf-series-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted-text, #6b7280);
}

.tf-series-streak {
  font-size: 0.85rem;
}

.tf-series-label {
  font-size: 0.78rem;
  color: var(--muted-text, #6b7280);
  margin-right: 4px;
}

.tf-series-value {
  font-size: 0.9rem;
  font-weight: 500;
}

.tf-series-metrics {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tf-series-prob-detail .tf-series-value {
  font-size: 0.85rem;
}

/* Placeholder */

.tf-placeholder {
  font-size: 0.9rem;
  color: var(--muted-text, #6b7280);
}

/* Explicateur */

.tf-explainer {
  margin-top: 24px;
  padding-bottom: 40px;
}

.tf-explainer ul {
  padding-left: 18px;
}

.tf-explainer li {
  margin-bottom: 6px;
  font-size: 0.92rem;
}

/* Responsif */

@media (max-width: 1024px) {
  .tf-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .tf-team-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .tf-series-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .tf-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- Amélioration section filtres ---- */

.tf-filters-section {
  margin-top: 24px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: var(--card-bg, #ffffff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
}

/* grille principale un peu espacée après les filtres */
.tf-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

/* Container des boutons de ligue */

.league-buttons {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Boutons ligues en "pill" lisibles */

.league-button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.league-button:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

.league-button.active {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

/* Bloc de tri plus visible */

.tf-sort-block select {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 6px 10px;
  background: #f9fafb;
  font-size: 0.9rem;
  outline: none;
}

.tf-sort-block select:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

/* ---- Explicateur + bloc texte bas en mode "carte" centrée ---- */

.tf-explainer,
.tf-info-section {
  margin-top: 24px;
  padding: 18px 18px 24px;
  border-radius: 18px;
  background: var(--card-bg, #ffffff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.tf-explainer h2,
.tf-info-section h2 {
  margin-bottom: 8px;
}

.tf-explainer p,
.tf-explainer li,
.tf-info-section p {
  font-size: 0.92rem;
  line-height: 1.5;
}

.tf-explainer ul {
  padding-left: 18px;
  margin-top: 8px;
}

.tf-explainer li {
  margin-bottom: 6px;
}

/* ---- Responsif filtres & ligues ---- */

@media (max-width: 1024px) {
  .tf-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .tf-filters-header {
    align-items: flex-start;
  }

  .tf-sort-block {
    width: 100%;
  }

  .league-buttons {
    max-height: 140px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .league-button {
    font-size: 0.8rem;
  }
}

/* ===== Amélioration section filtres ===== */

.tf-filters-section {
  margin-top: 24px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: var(--card-bg, #ffffff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
}

/* On met le titre + texte, puis le tri en dessous
   au lieu d'être tassés côte à côte */
.tf-filters-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

/* Bloc de tri plus visible */

.tf-sort-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.tf-sort-block .filter-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.tf-sort-block select {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 6px 10px;
  background: #f9fafb;
  font-size: 0.9rem;
  outline: none;
}

.tf-sort-block select:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

/* Container des ligues : lisible, wrap, plusieurs lignes si besoin */

.league-buttons {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Boutons de ligue en pills */

.league-button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.league-button:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

.league-button.active {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

/* ===== Explicateur + bloc info en cartes centrées ===== */

.tf-explainer,
.tf-info-section {
  margin-top: 24px;
  padding: 18px 18px 24px;
  border-radius: 18px;
  background: var(--card-bg, #ffffff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.tf-explainer h2,
.tf-info-section h2 {
  margin-bottom: 8px;
}

.tf-explainer p,
.tf-explainer li,
.tf-info-section p {
  font-size: 0.92rem;
  line-height: 1.5;
}

.tf-explainer ul {
  padding-left: 18px;
  margin-top: 8px;
}

.tf-explainer li {
  margin-bottom: 6px;
}

/* ===== Grille principale : légère marge au-dessus ===== */

.tf-main-grid {
  margin-top: 24px;
}

/* ===== Responsif ===== */

@media (max-width: 1024px) {
  .tf-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .tf-sort-block {
    width: 100%;
  }

  .league-buttons {
    max-height: 140px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .league-button {
    font-size: 0.8rem;
  }
}
/* SECTION FILTRES : carte centrée dans la page */
.tf-filters-section {
  margin-top: 24px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: var(--card-bg, #ffffff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
}

/* On centre juste le header à l’intérieur de la section */
.tf-filters-header {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* On garde le bloc tri propre, mais sans le centrer de force */
.tf-sort-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.tf-sort-block .filter-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.tf-sort-block select {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 6px 10px;
  background: #f9fafb;
  font-size: 0.9rem;
  outline: none;
}

.tf-sort-block select:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

/* Correction d’alignement du titre de la section filtres */
.tf-filters-header h2.section-title {
    text-align: center;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px !important; /* réduit l'espace et recentre visuellement */
}

.tf-series-owner {
  font-size: 0.82rem;
  margin-top: -2px;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  display: inline-block;
}

.tf-series-owner.good {
  background: #ecfdf5;
  color: #065f46;
}

.tf-series-owner.bad {
  background: #fef2f2;
  color: #b91c1c;
}

/* --- TP hero adaptation (team form insights) --- */

.tp-hero .section-title,
.tp-hero .section-subtitle{
  text-align: center;
}

.tp-hero .section-subtitle{
  margin-left: auto;
  margin-right: auto;
  max-width: 80ch;
}

/* Liens utiles dans la hero (optionnel) */
.tf-hero-actions{
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tf-hero-link{
  color: #fff;
  font-weight: 800;
  text-decoration: underline;
  opacity: 0.95;
}

.tf-hero-link:hover{
  text-decoration: none;
  opacity: 1;
}

.tf-league-select-wrapper {
  margin: 16px auto 0 auto; /* centre horizontalement */
  margin-top: 12px;
  align-items: stretch; /* IMPORTANT */
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 360px;
}

.tf-league-select-wrapper select {
  appearance: none;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  font-size: 0.95rem;
  cursor: pointer;
}

.tf-league-select-wrapper select:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
  outline: none;
}
