/* ── Infiny CDM 2026 – Public CSS ────────────────────────────────────────── */

/* ── Section matchs ─────────────────────────────────────────────────────── */
.icdm-matchs-section {
    margin: 28px 0 20px;
    padding: 22px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 1px solid #e0e4f5;
}
.icdm-matchs-title { font-size: 1.1em; font-weight: 700; margin: 0 0 4px; color: var(--wrc-primary, #1a73e8); }
.icdm-optional     { font-size: .8em; font-weight: 400; color: #888; margin-left: 6px; }
.icdm-matchs-hint  { font-size: .87em; color: #666; margin: 0 0 18px; }
.icdm-subtitle     { font-size: .9em; color: #555; margin: -6px 0 18px; }

/* ── Ligne match ─────────────────────────────────────────────────────────── */
.icdm-match-row {
    background: #fff;
    border: 1px solid #e0e4f5;
    border-radius: 8px;
    padding: 13px 15px;
    margin-bottom: 10px;
    transition: box-shadow .2s;
}
.icdm-match-row:hover { box-shadow: 0 2px 12px rgba(26,115,232,.1); }

/* Verrouillé */
.icdm-match-locked {
    background: #f5f5f5;
    border-color: #ddd;
    opacity: .85;
}
.icdm-match-locked .icdm-score-input {
    background: #ebebeb !important;
    color: #aaa !important;
    cursor: not-allowed;
    border-color: #ccc !important;
}

/* Meta (phase, heure, stade) */
.icdm-match-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    font-size: .82em;
    color: #666;
}
.icdm-match-phase       { font-weight: 700; color: var(--wrc-primary, #1a73e8); }
.icdm-match-heure       { color: #555; }
.icdm-match-stade       { color: #888; font-size: .95em; }
.icdm-match-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #e74c3c;
    color: #fff;
    font-size: .78em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    letter-spacing: .2px;
}

/* ── Scores ──────────────────────────────────────────────────────────────── */
.icdm-match-scores {
    display: flex;
    align-items: center;
    gap: 10px;
}
.icdm-equipe {
    flex: 1;
    font-weight: 600;
    font-size: .97em;
    display: flex;
    align-items: center;
    gap: 7px;
}
.icdm-equipe-a { justify-content: flex-end; text-align: right; flex-direction: row; }
.icdm-equipe-b { justify-content: flex-start; text-align: left;  flex-direction: row; }

/* Drapeaux */
.icdm-flag {
    display: inline-block;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
    flex-shrink: 0;
}
.icdm-flag-right { order: 2; } /* drapeau après le nom pour équipe A */
.icdm-flag-left  { order: 0; } /* drapeau avant le nom pour équipe B */

/* Inputs score */
.icdm-score-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.icdm-score-input {
    width: 54px !important;
    height: 48px;
    font-size: 1.4em;
    font-weight: 700;
    text-align: center;
    border: 2px solid #dde2f0;
    border-radius: 8px;
    padding: 4px;
    transition: border-color .2s, box-shadow .2s;
    -moz-appearance: textfield;
    appearance: textfield;
}
.icdm-score-input::-webkit-outer-spin-button,
.icdm-score-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.icdm-score-input:focus {
    outline: none;
    border-color: var(--wrc-primary, #1a73e8);
    box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}
.icdm-score-input.icdm-filled {
    border-color: var(--wrc-primary, #1a73e8);
    background: #f0f5ff;
}
.icdm-score-sep { font-size: 1.5em; font-weight: 700; color: #aaa; }

/* ── Bouton submit ───────────────────────────────────────────────────────── */
.icdm-submit-btn { width: 100%; padding: 14px; font-size: 1.05em; font-weight: 700; margin-top: 8px; }

/* ── Notice pas de match ─────────────────────────────────────────────────── */
.icdm-no-match { font-size: 1em; padding: 20px 24px; }
.icdm-error    { color: #c0392b; font-style: italic; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .icdm-match-scores { flex-direction: column; gap: 8px; }
    .icdm-equipe       { justify-content: center !important; text-align: center; width: 100%; }
    .icdm-equipe-a     { flex-direction: row-reverse; }
    .icdm-score-inputs { justify-content: center; }
    .icdm-score-input  { width: 50px !important; height: 44px; font-size: 1.3em; }
    .icdm-flag         { width: 24px !important; height: 18px !important; }
}

/* ── Encart "tous matchs clôturés" ──────────────────────────────────────── */
.icdm-all-locked-notice {
    margin-top: 16px;
    margin-bottom: 0;
    font-weight: 600;
}

/* ── Score définitif (cases grisées match commencé) ─────────────────────── */
.icdm-score-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
.icdm-score-definitive {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 48px;
    font-size: 1.4em;
    font-weight: 700;
    color: #555;
    background: #ebebeb;
    border: 2px solid #ccc;
    border-radius: 8px;
}
.icdm-score-label {
    font-size: .72em;
    color: #888;
    text-align: center;
    letter-spacing: .2px;
    margin-top: 1px;
}
.icdm-tab-display {
    font-size: .75em;
    color: #666;
    font-weight: 600;
    text-align: center;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 2px 7px;
    margin-top: 2px;
}

/* ── Section TAB dans le formulaire de prono ─────────────────────────────── */
.icdm-tab-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    justify-content: center;
}
.icdm-tab-label {
    font-size: .8em;
    color: #666;
    font-weight: 600;
    white-space: nowrap;
}
.icdm-score-input--tab {
    width: 44px !important;
    height: 38px;
    font-size: 1.1em !important;
}

/* ── Wrapper scores + TAB ────────────────────────────────────────────────── */
.icdm-match-scores-wrap { width: 100%; }

/* ── Score TAB dans tableau admin ────────────────────────────────────────── */
.icdm-score-tab { font-size: .75em; font-weight: 400; color: #888; }
.icdm-modal-score-input--tab { width: 56px !important; font-size: 1.2em !important; opacity: .85; }

/* ── Surcharge message erreur/succès (indépendant des variables CSS WRC) ── */
#icdm-message.error {
    background: #f8d7da !important;
    color: #721c24 !important;
    border-left: 4px solid #dc3545 !important;
}
#icdm-message.success {
    background: #d4edda !important;
    color: #155724 !important;
    border-left: 4px solid #28a745 !important;
}

/* ── Report de match ─────────────────────────────────────────────────────── */
.icdm-heure-barre {
    text-decoration: line-through;
    opacity: .5;
    font-size: .9em;
}
.icdm-heure-report {
    font-weight: 700;
    color: #e67e22;
    margin-left: 2px;
}
.icdm-badge-reporte {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #fff3cd;
    color: #856404;
    font-size: .75em;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
    border: 1px solid #ffc107;
    margin-left: 4px;
    vertical-align: middle;
}
