/* ============================================================
   PALMARÈS — Styles du tableau, de la recherche et de la popup
   ============================================================ */

/* --- Conteneur principal --- */
.palmares-concours {
    margin: 2rem 0;
    font-family: Arial, sans-serif;
    font-size: smaller;
}

.palmares-concours h3 {
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
}

.palmares-filtres {
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 15px 0;
    font-weight: bold;
}

.palmares-vide {
    padding: 20px;
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    color: #555;
}

/* --- Champ de recherche --- */
.palmares-search-input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* --- Export CSV --- */
.palmares-export {
    margin-bottom: 15px;
}

/* --- Tableau du palmarès --- */
.palmares-table {
    table-layout: auto;
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.palmares-table th,
.palmares-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

.palmares-table th {
    background-color: #f9f9f9;
    font-weight: bold;
}

.palmares-table tr:hover {
    background-color: #f5f5f5;
}

/* --- Diplômes --- */
.diplome {
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
    padding: 4px 8px;
}

.diplome-or {
    background-color: #D4AF37;
    color: white;
}

.diplome-argent {
    background-color: #C0C0C0;
    color: black;
}

.diplome-bronze {
    background-color: #CD7F32;
    color: white;
}

.diplome-download {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-bottom: 1px dashed currentColor;
}

/* --- Lien Score cliquable --- */
.score-link {
    cursor: pointer;
    text-decoration: underline;
    color: #0073aa;
    font-weight: bold;
    transition: color 0.2s;
}

.score-link:hover {
    color: #005177;
}

/* ============================================================
   MODAL / POPUP — Détails du score
   ============================================================ */
.palmares-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 999999;
    animation: palmares-fade-in 0.2s ease;
}

@keyframes palmares-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.palmares-modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px 35px;
    border-radius: 10px;
    max-width: 860px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.palmares-modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    color: #888;
    line-height: 1;
    transition: color 0.2s;
}

.palmares-modal-close:hover {
    color: #333;
}

/* --- En-tête de la popup --- */
.palmares-modal-title {
    margin: 0 0 6px 0;
    font-size: 1.3em;
    color: #23282d;
}

.palmares-modal-meta {
    margin: 0 0 4px 0;
    color: #555;
    font-size: 0.95em;
}

.palmares-modal-meta strong {
    color: #23282d;
}

.palmares-modal-divider {
    border: none;
    border-top: 2px solid #eee;
    margin: 16px 0;
}

/* --- Section Épreuve (titre + scores) --- */
.palmares-section-title {
    font-size: 1.15em;
    margin: 18px 0 10px 0;
    color: #0073aa;
}

.palmares-score-summary {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.palmares-score-badge {
    background: #f0f6fc;
    border: 1px solid #c3d9ed;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: bold;
    font-size: 0.95em;
    color: #1a3d5c;
}

.palmares-score-badge.final {
    background: #e6f9e6;
    border-color: #a3d9a3;
    color: #1a5c1a;
}

/* --- Tableau de détail des questions --- */
.palmares-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.92em;
}

.palmares-detail-table th,
.palmares-detail-table td {
    padding: 10px 12px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

.palmares-detail-table th {
    background: #f5f5f5;
    font-weight: bold;
    white-space: nowrap;
}

.palmares-detail-table tr:nth-child(even) {
    background: #fafafa;
}

.palmares-detail-table .col-question-content {
    max-width: 320px;
    line-height: 1.45;
}

.palmares-detail-table .col-question-content p {
    margin: 0 0 4px 0;
}

.palmares-detail-table .col-question-content img {
    max-width: 100%;
    height: auto;
}

.palmares-detail-table .col-center {
    text-align: center;
    white-space: nowrap;
}

/* --- Statuts --- */
.status-correct {
    color: #1a8c1a;
    font-weight: bold;
}

.status-incorrect {
    color: #cc2222;
    font-weight: bold;
}

.status-eliminee {
    color: #d4880f;
    font-weight: bold;
}

.status-joker {
    color: #0073aa;
    font-weight: bold;
}

/* --- Info complémentaire (éliminées / joker) --- */
.palmares-strategy-info {
    background: #fffbe6;
    border: 1px solid #f0e6a0;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.93em;
    color: #555;
}

.palmares-strategy-info strong {
    color: #333;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .palmares-modal-box {
        padding: 20px 16px;
        width: 97%;
    }

    .palmares-score-summary {
        flex-direction: column;
        gap: 8px;
    }

    .palmares-detail-table {
        font-size: 0.82em;
    }

    .palmares-detail-table .col-question-content {
        max-width: 180px;
    }
}
