/* Police Montpellier */
@font-face {
    font-family: 'Montpellier';
    src: url('../../../assets/fonts/Montpellier/woff/Montpellier-Light.woff2') format('woff2'),
         url('../../../assets/fonts/Montpellier/woff/Montpellier-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montpellier';
    src: url('../../../assets/fonts/Montpellier/woff/Montpellier-Regular.woff2') format('woff2'),
         url('../../../assets/fonts/Montpellier/woff/Montpellier-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montpellier';
    src: url('../../../assets/fonts/Montpellier/woff/Montpellier-Medium.woff2') format('woff2'),
         url('../../../assets/fonts/Montpellier/woff/Montpellier-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montpellier';
    src: url('../../../assets/fonts/Montpellier/woff/Montpellier-Bold.woff2') format('woff2'),
         url('../../../assets/fonts/Montpellier/woff/Montpellier-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montpellier';
    src: url('../../../assets/fonts/Montpellier/woff/Montpellier-ExtraBold.woff2') format('woff2'),
         url('../../../assets/fonts/Montpellier/woff/Montpellier-ExtraBold.woff') format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montpellier', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: none;
    color: #1a1a2e;
    line-height: 1.6;
}

header {
    background: #0356F2;
    color: #fff;
    padding: 1rem;
    margin-bottom: 30px;
    border-radius: 12px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    
}

header .subtitle {
    font-size: 1.3rem;
    opacity: 0.85;
}

main {
    margin: 0 auto;
    padding: 0;
    margin: 0;
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 1.5rem;
    align-items: start;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.8rem;
    box-shadow: none;
    border: 1px solid #E5E7EB;
}

.card h2 {
    font-size: 1.25rem;
    
    color: #0356F2;
    border-bottom: 2px solid #e8ecf1;
    padding-bottom: 0.5rem;
}

.update-time {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.icon-clock {
    vertical-align: middle;
    position: relative;
    top: -1px;
}

/* Chiffres cles */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.stat-box {
    text-align: center;
    padding: 1rem 0.5rem;
    background: #f7f9fc;
    border-radius: 8px;
}

.stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #0356F2;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.2rem;
}

/* Loader */
.loader {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 2rem 0;
    color: #888;
    font-size: 0.95rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e8ecf1;
    border-top-color: #0356F2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Barres de resultats */
.barre-item {
    margin-bottom: 1rem;
}

.barre-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    
}

.barre-candidat {
    font-weight: 600;
    font-size: 0.9rem;
    
    
}

.barre-liste {
    font-weight: 400;
    font-size: 0.75rem;
    display: block;
    width: 100%;
    color: #888;
}

.barre-score {
    font-size: 0.9rem;
    font-weight: 700;
    color: #555;
    
    margin-left: 1rem;
    text-align: right;
}

.barre-track {
    background: #e8ecf1;
    border-radius: 6px;
    height: 28px;
    overflow: hidden;
    position: relative;
}

.barre-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    padding-left: 10px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
}

.barre-fill.rank-1 { background: linear-gradient(90deg, #0356F2, #0077cc); }
.barre-fill.rank-2 { background: linear-gradient(90deg, #e63946, #ff6b6b); }
.barre-fill.rank-3 { background: linear-gradient(90deg, #2a9d8f, #40c9a2); }
.barre-fill.rank-default { background: #8896a7; }

/* Labels bureaux sur la carte */
.bureau-label {
    background: none;
    border: none;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 3px rgba(0,0,0,0.7), 0 0 1px rgba(0,0,0,0.9);
    line-height: 14px;
}

/* Carte */
#map {
    height: 500px;
    width: 100%;
    border-radius: 8px;
}

.carte-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.carte-controls label {
    font-weight: 600;
    font-size: 0.9rem;
}

.carte-controls select {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
}

#carte-section {
    margin-top: 1.5rem;
}

.bureau-popup {
    font-size: 0.85rem;
    line-height: 1.5;
}

.bureau-popup strong {
    font-size: 0.95rem;
}

.bureau-popup .winner {
    color: #0356F2;
    font-weight: 600;
}

.bureau-popup table {
    margin-top: 0.5rem;
    border-collapse: collapse;
    width: 100%;
}

.bureau-popup td {
    padding: 0.15rem 0.4rem;
}

.legend {
    background: white;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    font-size: 0.8rem;
    line-height: 1.6;
}

.legend h4 {
    margin: 0 0 6px;
    font-size: 0.85rem;
}

.legend i {
    width: 16px;
    height: 16px;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
    border-radius: 3px;
}

footer {
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    margin-top: 1.5rem;
}

footer a {
    color: #0356F2;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

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

    #chiffres-cles {
        order: -1;
        overflow-x: auto;
    }

    .stats-grid {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .stat-box {
        min-width: 110px;
        flex-shrink: 0;
    }

    header h1 {
        font-size: 1.26rem;
    }

    .card {
        padding: 1.2rem;
    }

    .stat-value {
        font-size: 1.17rem;
    }


    .barre-candidat {
        font-size: 0.81rem;
    }

    .barre-score {
        font-size: 0.81rem;
        
    }

    .bureau-popup {
        font-size: 0.63rem;
    }

    .bureau-popup strong {
        font-size: 0.72rem;
    }
}

/* Bandeau bureaux dépouillés */
.bureaux-info {
    background: #e8f4fd;
    color: #0356F2;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.2rem;
    text-align: center;

}

/* Badge qualifié 2nd tour */
.badge-qualifie {
    display: inline-block;
    background: #0356F2;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

