html,
body {

    width: 100%;
    height: 100%;

    margin: 0;

    overflow: hidden;

    font-family: Arial, sans-serif;

    background: #dddddd;

}


/* =====================================================
   PAGE PRINCIPALE
   ===================================================== */

#page {

    width: 100vw;
    height: 100vh;

    display: flex;

}


/* =====================================================
   COLONNE GAUCHE
   ===================================================== */

#colonne-gauche {

    width: 230px;
    height: 100vh;

    flex-shrink: 0;

    display: flex;
    flex-direction: column;

    box-sizing: border-box;

    padding: 4px;

    gap: 8px;

    background: #e5e5e5;

}


/* =====================================================
   WRAPPER SWIPE
   PC / TABLETTE :
   transparent pour conserver l'ancien layout
   ===================================================== */

#swipe-gauche {

    display: contents;

}


/* =====================================================
   CLASSEMENT EQUIPES
   ===================================================== */

#classement-team {

    width: 222px;
    height: 300px;

    flex-shrink: 0;

    background: white;

    border: 1px solid #777;

    border-radius: 8px;

    box-sizing: border-box;

    overflow-y: auto;

    font-family: Arial, sans-serif;
    font-size: 11px;

}


/* =====================================================
   CLASSEMENT INDIVIDUEL
   ===================================================== */

#classement-individuel {

    width: 222px;

    flex: 1;

    min-height: 0;

    background: white;

    border: 1px solid #777;

    border-radius: 8px;

    box-sizing: border-box;

    overflow-y: auto;

    font-family: Arial, sans-serif;
    font-size: 11px;

}


/* =====================================================
   ZONE CARTE
   ===================================================== */

#zone-carte {

    flex: 1;

    height: 100vh;

    min-width: 0;

    position: relative;

}


#map {

    width: 100%;
    height: 100%;

    overflow: hidden;

}


/* =====================================================
   TITRES
   ===================================================== */

.titre-classement {

    position: sticky;

    top: 0;

    z-index: 30;

    padding: 7px 4px;

    text-align: center;

    font-size: 12px;

    font-weight: bold;

    background: #eeeeee;

    border-bottom: 1px solid #aaa;

}


/* =====================================================
   TABLEAUX
   ===================================================== */

table {

    width: 100%;

    border-collapse: collapse;

    font-family: Arial, sans-serif;

    font-size: 11px;

}


thead {

    position: sticky;

    top: 29px;

    z-index: 20;

}


th {

    padding: 5px 4px;

    text-align: left;

    font-size: 10px;

    font-weight: normal;

    border-bottom: 1px solid #aaa;

    background: #fafafa;

}


td {

    padding: 4px;

    font-size: 11px;

    border-bottom: 1px solid #dddddd;

}


tbody tr:hover {

    background: #eeeeee;

}


/* =====================================================
   COLONNES
   ===================================================== */

.rang {

    width: 24px;

    text-align: center;

}


.points {

    width: 45px;

    text-align: right;

    font-weight: bold;

}


.segments {

    width: 35px;

    text-align: right;

}


.nom {

    text-align: left;

}


/* =====================================================
   LIGNES CLASSEMENT INDIVIDUEL
   ===================================================== */

.ligne-classement {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 6px;

    padding: 4px;

    box-sizing: border-box;

    font-family: Arial, sans-serif;

    font-size: 11px;

    line-height: 1.2;

    border-bottom: 1px solid #dddddd;

}


.ligne-classement:hover {

    background: #eeeeee;

}


/* =====================================================
   UTILISATEUR CONNECTE
   ===================================================== */

.utilisateur-connecte {

    background: #fff3b0;

    font-weight: bold;

    border-radius: 5px;

}


/* =====================================================
   SELECTEUR DE MODE CARTE
   ===================================================== */

#mode-carte {

    position: absolute;

    top: 10px;
    left: 50%;

    transform: translateX(-50%);

    z-index: 1000;

    display: flex;

    gap: 4px;

    background: white;

    padding: 4px;

    border-radius: 8px;

    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);

}


#mode-carte button {

    border: none;

    padding: 8px 14px;

    border-radius: 5px;

    cursor: pointer;

    font-family: Arial, sans-serif;

    font-size: 13px;

    background: #eeeeee;

}


#mode-carte button:hover {

    background: #dddddd;

}


#mode-carte button.mode-actif {

    background: #444444;

    color: white;

}


/* =====================================================
   UTILISATEUR / LOGIN / BACKFILL
   ===================================================== */

.bloc-utilisateur {

    display: flex;
    flex-direction: column;

    gap: 6px;

    width: 100%;

    box-sizing: border-box;

}


.btn-utilisateur {

    display: block;

    width: 100%;

    box-sizing: border-box;

    padding: 8px 10px;

    border: none;
    border-radius: 6px;

    text-align: center;

    font-size: 13px;
    font-weight: bold;

    text-decoration: none;

    cursor: pointer;

}


.btn-login {

    background: #fc4c02;
    color: white;

}


.btn-login:hover {

    background: #e34402;

}


.btn-logout {

    background: #333333;
    color: white;

}


.btn-logout:hover {

    background: #555555;

}


.btn-backfill {

    background: #eeeeee;
    color: #222222;

    border: 1px solid #bbbbbb;

}


.btn-backfill:hover {

    background: #dddddd;

}


.btn-backfill:disabled {

    opacity: 0.6;

    cursor: wait;

}


/* =====================================================
   AFFICHAGE TELEPHONE
   ===================================================== */

@media (max-width: 700px) {

    html,
    body {

        width: 100%;
        height: 100%;

        margin: 0;

        overflow: hidden;

    }


    /* =====================================================
       PAGE
       ===================================================== */

    #page {

        position: relative;

        width: 100vw;
        height: 100vh;

        display: block;

        overflow: hidden;

    }


    /* =====================================================
       COLONNE GAUCHE
       ===================================================== */

    #colonne-gauche {

        position: static;

        width: 0;
        height: 0;

        padding: 0;
        margin: 0;

        background: transparent;

        overflow: visible;

    }


    /* =====================================================
       ZONE CARTE PLEIN ECRAN
       ===================================================== */

    #zone-carte {

        position: absolute;

        top: 0;
        left: 0;

        width: 100vw !important;
        height: 100vh !important;

        z-index: 1;

    }


    #map {

        width: 100%;
        height: 100%;

    }


    /* =====================================================
       PANNEAU GAUCHE
       UTILISATEUR + CLASSEMENT EQUIPES
       ===================================================== */

    #swipe-gauche {

        display: flex;

        position: absolute;

        top: 0;
        left: 0;

        width: 85vw;
        max-width: 340px;

        height: 100vh;

        z-index: 1200;

        flex-direction: column;

        box-sizing: border-box;

        transform: translateX(-100%);

        transition: transform 0.25s ease;

        overflow: hidden;

        background: #e5e5e5;

        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.25);

    }


    #swipe-gauche.ouvert {

        transform: translateX(0);

    }


    /* =====================================================
       APERCU MENU GAUCHE
       ===================================================== */

    #swipe-gauche.apercu-menu {

        transform: translateX(
            calc(-100% + 40px)
        );

    }


    /* =====================================================
       BLOC UTILISATEUR
       ===================================================== */

    #swipe-gauche .bloc-utilisateur {

        width: 100%;

        box-sizing: border-box;

        flex-shrink: 0;

        margin: 0;
        padding: 0;

    }


    /* =====================================================
       BOUTONS UTILISATEUR
       ===================================================== */

    #swipe-gauche .btn-utilisateur {

        display: block;

        width: 100%;

        box-sizing: border-box;

        margin: 0;

        text-align: center;

        text-decoration: none;

        border-radius: 0;

    }


    #swipe-gauche .btn-utilisateur + .btn-utilisateur {

        margin-top: 4px;

    }


    /* =====================================================
       CLASSEMENT EQUIPES
       ===================================================== */

    #classement-team {

        position: static;

        width: 100%;
        height: auto;

        flex: 1;

        box-sizing: border-box;

        overflow-y: auto;

        transform: none;

        box-shadow: none;

        border-radius: 0;

    }


    #classement-team table {

        width: 100%;

        box-sizing: border-box;

        border-collapse: collapse;

    }


    /* =====================================================
       CLASSEMENT INDIVIDUEL
       CACHE A DROITE
       ===================================================== */

    #classement-individuel {

        position: absolute;

        top: 0;
        right: 0;

        width: 85vw;
        max-width: 340px;

        height: 100vh;

        z-index: 1200;

        box-sizing: border-box;

        transform: translateX(100%);

        transition: transform 0.25s ease;

        overflow-y: auto;

        background: white;

        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.25);

        border-radius: 0;

    }


    #classement-individuel.ouvert {

        transform: translateX(0);

    }


    /* =====================================================
       APERCU MENU DROIT
       ===================================================== */

    #classement-individuel.apercu-menu {

        transform: translateX(
            calc(100% - 40px)
        );

    }


    /* =====================================================
       SELECTEUR DE MODE
       ===================================================== */

    #mode-carte {

        top: 10px;

        left: 50%;

        transform: translateX(-50%);

        z-index: 1500;

    }


    #mode-carte button {

        padding: 8px 14px;

        font-size: 13px;

    }

}
