/* =========================================================
   FAIR ODDS WIDGET (MODULAR) - CLEAN DESIGN
   ========================================================= */

.fo-table-wrapper {
  margin-top: 1.5rem;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Structure Grid ── */
.fo-header-row, .fo-row {
  display: grid;
  grid-template-columns: 50px minmax(125px, 1fr) 55px 50px 50px 45px 60px 60px 60px;
  gap: 0;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0;
}

/* ── Header ── */
.fo-header-row {
  font-size: 0.65rem;
  font-weight: 700;
  color: #8899ac;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
.fo-header-row .fo-col { padding-bottom: 0.5rem; }

/* ── Rows ── */
.fo-row {
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
}
.fo-row:hover { 
  background: rgba(255, 255, 255, 0.03); 
  border-radius: 6px; 
}

[data-theme="light"] .fo-header-row, [data-theme="light"] .fo-row { border-bottom-color: var(--lt-border-soft); }
[data-theme="light"] .fo-row:hover { background: var(--lt-hover); }

/* ── En-tête groupé des Cotes sur 3 colonnes ── */
.fo-col--odds-group {
  grid-column: span 3;
  display: flex; flex-direction: column; align-items: center; width: 100%;
}
.odds-title {
  font-size: 0.55rem; text-align: center; line-height: 1.1; margin-bottom: 6px;
  white-space: nowrap;
}
.odds-sub {
  display: grid; grid-template-columns: 1fr 1fr 1fr; width: 100%; gap: 0;
}
.odds-sub span { text-align: center; width: 100%; font-size: 0.65rem; }

/* ── Cells génériques ── */
.fo-col { 
  display: flex; align-items: center; justify-content: center; 
  padding: 0.6rem 0.4rem;
  height: 100%; 
}
.fo-col--time { justify-content: flex-start; padding-left: 0.5rem; }
.fo-col--match { justify-content: flex-start; }

/* ── Time & Postponed ── */
.fo-time { font-family: monospace; font-size: 0.8rem; font-weight: 600; color: #e5e7eb; }
.fo-time.postponed { color: #f87171; font-size: 0.7rem; letter-spacing: 0.5px; }
[data-theme="light"] .fo-time { color: var(--lt-text-2); }
[data-theme="light"] .fo-time.postponed { color: var(--lt-error); }

/* ── Teams ── */
.fo-teams {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.8rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #ffffff;
}
[data-theme="light"] .fo-teams { color: var(--lt-text); }
.fo-team-row { display: flex; align-items: center; gap: 0.5rem; }
.fo-team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fo-team--favorite { color: gold !important; }
[data-theme="light"] .fo-team--favorite { color: #d97706 !important; }
.fo-logo { width: 1.1rem; height: 1.1rem; object-fit: contain; flex-shrink: 0; }

/* ── Score Badge ── */
.fo-score {
  font-size: 0.8rem; font-weight: 700; padding: 0.2rem 0.4rem; border-radius: 4px;
  background: rgba(0, 0, 0, 0.3); text-align: center; color: #ffffff;
  white-space: nowrap; min-width: max-content; width: 100%;
}
.fo-score--future { background: transparent; color: #6b7280; }
[data-theme="light"] .fo-score { background: rgba(0, 0, 0, 0.05); color: var(--lt-text); }

/* ── Chips (Fair / Pred) ── */
.fo-chip {
  padding: 0.2rem 0.35rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700;
  text-align: center; min-width: 32px; border: 1px solid transparent;
}
.fo-chip--none { background: rgba(255, 255, 255, 0.05); color: #9ca3af; border-color: rgba(255, 255, 255, 0.1); }
.fo-chip--blue { background: rgba(0, 0, 0, 0.2); border-color: rgba(59, 130, 246, 0.5); color: #60a5fa; }
.fo-chip--dc   { background: rgba(0, 0, 0, 0.2); border-color: rgba(168, 85, 247, 0.5); color: #c084fc; }
.fo-chip--goals { background: rgba(0, 0, 0, 0.2); border-color: rgba(251, 146, 60, 0.5); color: #fb923c; }
.fo-chip--correct { background: rgba(74, 222, 128, 0.1) !important; border-color: #4ade80 !important; color: #4ade80 !important; }
.fo-chip--wrong   { background: rgba(248, 113, 113, 0.1) !important; border-color: #fecdd3 !important; color: #fecdd3 !important; opacity: 0.6; }

[data-theme="light"] .fo-chip--none { background: rgba(0, 0, 0, 0.05); color: var(--lt-text-3); }
[data-theme="light"] .fo-chip--blue { background: rgba(0, 0, 0, 0.03); border-color: rgba(37, 99, 235, 0.4); color: #1d4ed8; }
[data-theme="light"] .fo-chip--dc   { background: rgba(0, 0, 0, 0.03); border-color: rgba(147, 51, 234, 0.4); color: #7e22ce; }
[data-theme="light"] .fo-chip--goals { background: rgba(0, 0, 0, 0.03); border-color: rgba(249, 115, 22, 0.4); color: #ea580c; }

/* =========================================================
   HIÉRARCHIE VISUELLE : PRED > FAIR
   ========================================================= */

/* 1. Atténuer subtilement la colonne Fair pour qu'elle passe au second plan */
.fo-col--fair {
  opacity: 0.75;
  transform: scale(0.95);
  transition: opacity 0.2s ease;
}
.fo-row:hover .fo-col--fair {
  opacity: 0.95;
}
#th-fair {
  opacity: 0.6;
}

/* 2. Renforcer la colonne Pred pour qu'elle capte l'œil en premier */
.fo-col--pred .fo-chip {
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  filter: saturate(1.1) brightness(1.1); 
}
#th-pred {
  color: #e5e7eb;
  font-weight: 800;
}
[data-theme="light"] #th-pred { color: #000; }

/* ── Proba (%) ── */
.fo-prob { font-size: 0.75rem; font-weight: 600; color: #9ca3af; }
.fo-na { opacity: 0.3; }
[data-theme="light"] .fo-prob { color: var(--lt-text-3); }

/* ── Cotes (1, X, 2) ── */
.fo-odds-cell { font-size: 0.75rem; font-weight: 500; text-align: center; width: 100%; color: #9ca3af; }
.fo-odds--na { opacity: 0.3; }
.fo-odds--hit { color: #ffffff; font-weight: 800; }
[data-theme="light"] .fo-odds-cell { color: var(--lt-text-2); }
[data-theme="light"] .fo-odds--hit { color: #000000; font-weight: 800; }

/* ── Comp Block ── */
.fo-comp-block { margin-top: 1.5rem; margin-bottom: 1rem; }
.comp-link {
  color: var(--color-green); font-weight: 600; font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 0.5rem; margin-bottom: 0.5rem;
  display: block; transition: color 0.2s ease;
}
.comp-link:hover { color: #34d399; }
.favorites-title { color: gold !important; }
[data-theme="light"] .comp-link { color: var(--lt-text); border-bottom-color: rgba(0, 0, 0, 0.1); }

/* ── Mobile View: Un Flou Parfait et Continu ! ── */
@media (max-width: 590px) {
  .fo-header-row, .fo-row {
    width: max-content; 
    min-width: 100%;
    grid-template-columns: 50px 125px 50px 46px 46px 45px 60px 60px 60px;
    padding-right: 1rem;
  }

  .fo-col--time, .fo-col--match {
    position: sticky;
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); 
    background: rgba(11, 18, 30, 0.05);
  }
  
  .fo-col--time { left: 0; }
  .fo-col--match { left: 50px; }

  .fo-header-row .fo-col--match::after,
  .fo-row .fo-col--match::after {
    content: ''; position: absolute; top: 0; right: -6px; width: 6px; height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.15), transparent); pointer-events: none;
  }

  .fo-row:hover .fo-col--time,
  .fo-row:hover .fo-col--match {
    background: rgba(255, 255, 255, 0.05); 
  }

  [data-theme="light"] .fo-col--time, [data-theme="light"] .fo-col--match {
    background: rgba(255, 255, 255, 0.6);
  }

  .comp-link {
    position: sticky;
    left: 0.5rem;
    width: max-content;
    max-width: 90vw;
    z-index: 10;
  }
}

.fo-skeleton-group { padding: 1rem 0; }
.fo-skeleton-row { height: 40px; margin-bottom: 0.4rem; border-radius: 6px; }