/* =====================================================
   STYLES PRINCIPAUX – EQUIGEST CSO
   Design clair, lisible et responsive
   ===================================================== */

/* ===== Structure globale ===== */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  color: #0f2742;
  background: #f7f9fc;
}

/* ===== Liens ===== */
a {
  color: #1e63d1;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}
a:hover {
  color: #1555b8;
}

/* =====================================================
   EN-TÊTE DU SITE
   ===================================================== */

header.site-header {
  background: #fff;
  border-bottom: 1px solid #e6e9ee;
  position: sticky; /* Fixe le header en haut de l’écran */
  top: 0;
  z-index: 10;      /* Pour rester au-dessus du contenu */
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ===== Logo / Marque ===== */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img {
  height: 32px;
}
.brand .brand-text {
  font-weight: 700;
  font-size: 18px;
  color: #0f2742;
}

/* ===== Navigation principale ===== */
nav.main-nav ul {
  display: flex;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
nav.main-nav a {
  padding: 6px 10px;
  border-radius: 8px;
}
nav.main-nav a:hover {
  background: #eef5ff;
}

/* =====================================================
   CONTENEUR PRINCIPAL
   ===================================================== */
.container {
  max-width: 1100px;
  margin: 16px auto;
  padding: 0 16px;
}

/* =====================================================
   TABLEAUX
   ===================================================== */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  border-bottom: 1px solid #e6e9ee;
  padding: 8px;
  text-align: left;
}
.table th {
  background: #f1f4f9;
  color: #0f2742;
  font-weight: 600;
}

/* =====================================================
   BOUTONS
   ===================================================== */
.btn {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #cdd6e1;
  border-radius: 8px;
  background: #fff;
  color: #0f2742;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn:hover {
  background: #f3f7ff;
}

/* Variante principale (bleue) */
.btn-primary {
  background: #1e90ff;
  border-color: #1e90ff;
  color: #fff;
}
.btn-primary:hover {
  background: #187ae5;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #0f2742;
  font-size: 12px;
  font-weight: 500;
}

/* =====================================================
   PIED DE PAGE
   ===================================================== */
footer {
  margin-top: 32px;
  border-top: 1px solid #e6e9ee;
  padding: 12px 16px;
  color: #445;
  font-size: 14px;
  text-align: center;
}

.site-footer .wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  text-align: center;
  color: #445;
  font-size: 14px;
}

/* =====================================================
   MESSAGES FLASH (succès / erreur / info)
   ===================================================== */
.flash-container {
  max-width: 900px;
  margin: 10px auto;
  padding: 0 16px;
}

.flash {
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-weight: 500;
}

.flash-success {
  background: #e8f9e8;
  border: 1px solid #7ac77a;
  color: #205620;
}
.flash-error {
  background: #ffe9e9;
  border: 1px solid #d77;
  color: #851b1b;
}
.flash-info {
  background: #e8f2ff;
  border: 1px solid #6b9de0;
  color: #0f2742;
}

/* =====================================================
   JURY UI
   ===================================================== */
.jury-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}
.panel{
  background:#fff;
  border:1px solid #e6e9ee;
  border-radius:12px;
  padding:12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.current-box{
  font-size:22px;
  font-weight:700;
  background:#f7fbff;
  border:1px dashed #bcd6ff;
  padding:10px;
  border-radius:10px;
  min-height:48px;
  display:flex;
  align-items:center;
}
.entries{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.entry-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px solid #eef2f7;
  border-radius:8px;
  padding:8px 10px;
  background:#fafcfe;
}
.entry-row .who{ font-weight:600; }
.entry-row .btns button{ margin-left:6px; }
.result-form .row{ display:flex; gap:16px; flex-wrap:wrap; margin:8px 0; }
.info{ color:#0a0; font-weight:600; }
.hint{ color:#556; font-size:13px; }

@media (max-width: 900px){
  .jury-grid{ grid-template-columns: 1fr; }
}

/* === Drag & Drop style === */
.entry-row.dragging {
  opacity: 0.5;
  background: #eef5ff;
  border: 2px dashed #1e63d1;
}

.entry-row {
  cursor: grab;
  user-select: none;
}

.entry-row:active {
  cursor: grabbing;
}

.drop-indicator{
  height:0;
  border-top:3px solid #1e63d1;
  border-radius:3px;
  margin:4px 0;
  pointer-events:auto; /* permite drop justo en la línea */
}

/* ==== Résultats des concurrents terminés ==== */
.entry-row.done {
  background: #f8f8f8;
  border-left: 4px solid #ccc;
}

.results-info {
  margin-top: 4px;
  font-size: 0.9em;
  color: #333;
  font-style: italic;
}

.results-info span.phase {
  font-weight: 600;
  color: #004080;
}

.results-info span.elim {
  color: #c00;
  font-weight: bold;
}

/* fila terminada (por defecto en verde muy claro) */
.entry-row.done { background: #eef9f0; border-color: #cfe7d3; }

/* diferenciamos eliminados */
.entry-row.done.is-elim { background: #fff4f4; border-color: #f3c8c8; }
.entry-row.done.is-elim .badge { background: #ffe2e2; color: #8a1f1f; }
.section-separator {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid #ddd;
}
.btn-disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    border: 1px solid #aaa;
}

.horse-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.horse-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.horse-result {
    flex-shrink: 0;
}
