
    html {
        height: 100%;
    }

    body{
        background-color: #f5f5f5;
        height: 100%;
        margin: 0%;
        font-family: 'Segoe UI', 'Calibri', 'Helvetica Neue', sans-serif;
    }

    main {
        padding-top: 80px;
    }

    @media (max-width: 768px) {
        main {
            padding-top: 53px;
        }
    }

    .all {
        min-height: 100%;
        display: flex;
        flex-direction: column;
    }

/* HEADER HEADER HEADER HEADER HEADER HEADER HEADER HEADER HEADER */
    header {
        position: fixed;
        top: 0;
        width: 100%;
        height: 80px;
        background: black;
        color: white;
        display: flex;
        align-items: center;
        justify-content: space-between;
        z-index: 1000;
    }

    header .Logo img {
        height: 80px;
        margin-left: 20px;
    }

    header .Burger {
        display: none;
        font-size: 30px;
        background: none;
        border: none;
        color: white;
        cursor: pointer;
        margin-right: 20px;
    }

    header .Menu {
        display: flex;
        gap: 20px;
        margin-right: 25px;
    }

    header .Menu a {
        color: white;
        text-decoration: none;
        line-height: 80px;
        font-weight: bold;
    }

    @media (max-width: 768px) {
        header {
            height: 53px;
        }

        header .Logo img {
            height: 53px;
        }

        header .Burger {
            display: block;
        }

        header .Menu {
            position: absolute;
            top: 53px;
            left: 50%;
            background: black;
            flex-direction: column;
            align-items: flex-start;
            width: 50%;
            padding: 10px;
            display: none;
        }

        header .Menu a {
            padding: 10px;
            line-height: normal;
            width: 100%;
        }

        header .Menu.show {
            display: flex;
        }
    }

/* HEADER COURSE HEADER COURSE HEADER COURSE HEADER COURSE HEADER COURSE HEADER COURSE */
    .Header_Course {
        display: flex;
        align-items: center;
        border-bottom: 6px solid;
        border-color: #407392;
    }

    .Header_Course Img {
        margin-inline: auto;
        max-height: 100px;
        max-width: 100px;
        padding-inline: 5px;
        padding-block: 5px;
    }

    .Header_Course a {
        display: flex;
        align-items: center;
        font-weight: bolder;
        font-family: 'Segoe UI', 'Calibri', 'Helvetica Neue', sans-serif;
        font-size: 25px;
        text-align: center;
    }

    @media (max-width: 768px) {
        .Header_Course Img {
            max-height: 50px;
            max-width: 50px;
        }
        
        .Header_Course a {
            font-size: 15px;
        }
    }

    .Select_Course {
        display: flex;
        border-bottom: 6px solid;
        border-color: #407392;
    }

    .Select_Course a {
        height: 50px;
        margin-inline: auto;
        padding-block: 5px;
    }

    .Select_Course img {
        height: 50px;
    }

    .Select_Course Select {
        font-weight: bolder;
        font-family: 'Segoe UI', 'Calibri', 'Helvetica Neue', sans-serif;
        font-size: 25px;
        text-align: center;
        border-width: 0;
    }

    @media (max-width: 768px) { 
        .Select_Course a {
            height: 25px;
        }
        
        .Select_Course img {
            height: 25px;
        }
        
        .Select_Course Select {
            font-size: 15px;
        }
    }

/* BOUTONS N1 BOUTONS N1 BOUTONS N1 BOUTONS N1 BOUTONS N1 BOUTONS N1 BOUTONS N1 BOUTONS N1  */
    .Barre_Bouton_Select {
        margin: 5px;
        margin-inline: 5%;
        border-bottom: 5px solid;
        border-color: #407392;
    }

    .Barre_Bouton_Select button {
        font-weight: bolder;
        font-size: 20px;
        color: white;
        padding: 7px;
        width: 160px;
        padding-inline: 0px;
        margin-top: 5px;
        background-color: black;
        cursor: pointer;
        border: 0px solid;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }

    .Barre_Bouton_Select button:hover {
        background-color: #407392;
    }

    .Barre_Bouton_Select .select {
        background-color: #407392;
    }

    @media (max-width: 768px) { 
        .Barre_Bouton_Select button {
            font-size: 14px;
            width: 100px;
            margin-top: 4px;
        }
    }

/* BOUTONS N2 BOUTONS N2 BOUTONS N2 BOUTONS N2 BOUTONS N2 BOUTONS N2 BOUTONS N2 BOUTONS N2 */
    .Barre_Bouton_Class {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 20px;
    }

    .Barre_Bouton_Class button {
        padding: 10px 20px;
        background-color: #407392;
        color: white;
        border: none;
        border-radius: 5px;
        font-size: 16px;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

    .Barre_Bouton_Class button:hover, .Barre_Bouton_Class button.selected {
        background-color: black;
    }

    @media (max-width: 768px) { 
        .Barre_Bouton_Class button {
            font-size: 14px;
        }
    }

/* CLASSEMENT CLASSEMENT CLASSEMENT CLASSEMENT CLASSEMENT CLASSEMENT CLASSEMENT CLASSEMENT CLASSEMENT */
    .Classement {
        width: 80%;
        margin: 20px auto;
        border-collapse: collapse;
        font-size: 14px;
        background-color: #ffffff;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        overflow: hidden;
    }

    .Classement thead {
        background-color: var(--item-color, #407392);
        color: white;
        text-align: center;
        font-weight: bold;
        font-size: 16px;
        text-transform: uppercase;
    }

    .Classement thead th {
        padding: 10px;
        border-bottom: 1px solid #dddddd;
    }

    @media (max-width: 768px) {
        .Classement {
            width: auto;
            font-size: 11px;
        }
        
        .Classement thead {
            font-size: 13px;
        }

        .Classement thead th, .Classement tbody tr td {
            padding: 5px;
        }

        .Classement .detail-col {
            display: none;
            transition: all 0.3s ease-in-out;
        }
    }

    @media (max-width: 500px) {
        .Classement {
            width: auto;
            font-size: 10px;
        }
        
        .Classement thead {
            font-size: 11px;
        }

        .Classement thead th, .Classement tbody tr td {
            padding: 2px;
        }

        .Classement .detail-col {
            display: none;
            transition: all 0.3s ease-in-out;
        }
    }

    .Classement tbody tr {
        text-align: center;
    }

    .Classement tbody tr td {
        padding: 10px;
        border-bottom: 1px solid #dddddd;
        color: #333;
    }

    .Classement tbody tr:nth-child(odd) {
        background-color: #f9f9f9;
    }

    .Classement tbody tr:nth-child(even) {
        background-color: #ffffff;
    }

    .Classement tbody tr td img {
        height: 16px;
        width: 24px;
        vertical-align: middle;
    }

    .Classement tbody tr:hover {
        background-color: #f1f1f1;
        cursor: pointer;
    }

    .Classement tbody tr td:nth-child(1),
    .Classement tbody tr td:nth-child(8),
    .Classement tbody tr td:nth-child(9) {
        font-weight: bold;
        color: #407392;
    }

    .Classement th:first-child,
    .Classement td:first-child {
        border-top-left-radius: 8px;
        border-bottom-left-radius: 8px;
    }

    .Classement th:last-child,
    .Classement td:last-child {
        border-top-right-radius: 8px;
        border-bottom-right-radius: 8px;
    }

    .classPartenaire {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin-right: 10%;
        font-size: 18px;
    }

    .classPartenaire img {
        max-height: 50px;
        margin-left: 10px;
    }

/* TIMELINE TIMELINE TIMELINE TIMELINE TIMELINE TIMELINE TIMELINE TIMELINE TIMELINE TIMELINE */
    .timeline-container {
        margin: 20px auto;
        width: 80%;
        max-width: 1200px;
    }

    .timeline {
        position: relative;
        padding: 20px 0;
        border-left: 3px solid #ddd;
    }

    .timeline-item {
        position: relative;
        margin: 20px 0;
        padding-left: 60px;
    }

    .timeline-item:before {
        content: '';
        position: absolute;
        left: -10px;
        top: 10px;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background-color: #fff;
        border: 3px solid var(--item-color, #ddd);
        z-index: 1;
    }

    .timeline-item h3 {
        margin: 0;
        font-size: 18px;
        color: var(--item-color, #333);
    }

    .timeline-item table {
        margin-top: 10px;
        border-collapse: collapse;
        width: 100%;
    }

    .timeline-item table:hover {
        transform: scale(1.05);
    }

    .timeline-item.start {
        --item-color: #4472C4;
    }

    .timeline-item.sprint {
        --item-color: #00B050;
    }

    .timeline-item.mountain {
        --item-color: red;
    }

    .timeline-item.other {
        --item-color: brown;
    }

    .timeline-item.bonif {
        --item-color: #FFB900;
    }

    .timeline-item.finish {
        --item-color: red;
    }

    .timeline-item img {
        position: absolute;
        left: -45px;
        top: 5px;
        width: 40px;
        height: 40px;
    }

    @media (max-width: 768px) {
        .timeline-container {
            width: 95%;
            margin: 20px auto;
        }

        .timeline {
            padding-left: 0;
        }

        .timeline-item {
            padding-left: 10px;
            margin: 15px 0;
            position: relative;
            margin-top: 50px;
        }

        .timeline-item:before {
            top: -25px;
            width: 15px;
            height: 15px;
        }

        .timeline-item img {
            top: -30px;
            left: 5px;
            width: 30px;
            height: 30px;
        }

        .timeline-item h3 {
            font-size: 16px;
            margin-bottom: 10px;
        }

        .timeline-item table {
            width: 100%;
            font-size: 12px;
        }

        .timeline-item table thead {
            font-size: 14px;
        }

        .timeline-item table th, .timeline-item table tbody td {
            padding: 5px;
        }

        .timeline-item.start {
            margin-top: 15px;
        }
    }


/* Styles par défaut (Mobile-first) */
.teams-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 95%;
    margin: 10px auto;
}

.team-card {
    background: white;
    border: 2px solid #407392;
    border-radius: 5px;
    padding: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.team-card .Classement {
    width: 95%;
    margin: 10px auto;
    border-collapse: collapse;
}

.team-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 10px auto;
    padding: 10px;
    text-align: center;
    background-color: #407392;
    color: white;
    border-radius: 5px;
    width: 90%;
}

/* Masquer la colonne catégorie d'âge sur petits écrans */
.team-card .Classement .AGE_CATEGORY {
    display: none;
}

.flag {
    width: 20px;
    height: auto;
}

/* Styles pour tablettes et écrans moyens */
@media (min-width: 768px) {
    .teams-list {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }

    .team-card .Classement .AGE_CATEGORY {
        display: table-cell;
    }
}

/* Styles pour grands écrans */
@media (min-width: 1024px) {
    .teams-list {
        grid-template-columns: repeat(auto-fit, minmax(375px, 1fr));
    }
}


.files-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 30px;
}

.file-card {
    display: flex;
    align-items: center;
    width: 300px;
    background-color: #ffffff;
    border: 2px solid #407392;
    border-radius: 8px;
    padding: 10px;
    text-decoration: none;
    color: black;
    transition: transform 0.2s, box-shadow 0.2s;
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.file-card img {
    width: 50px;
    height: 50px;
    margin-right: 15px;
}

.file-card .file-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #407392;
}

.Provisoire{
    width: 90%;
    margin-inline: 5%;
    margin-top: 5px;
    font-family: 'Segoe UI', 'Calibri', 'Helvetica Neue', sans-serif;
    font-size: 25px;
    font-weight: bolder;
    text-align: center;
    border-top: 6px solid;
    border-bottom: 6px solid;
    border-color: #407392;
}


/*LIVE LIVE LIVE LIVE LIVE*/
.CHRONO, .MOYENNE {
    width: 500px;
    border-radius: 20px;
    margin: 10px auto;
    background: #ffffff10;
    backdrop-filter: blur(10px);
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 70px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .CHRONO {
        width: 400px;
        font-size: 55px;
    }
}

@media (max-width: 500px) {
    .CHRONO {
        width: 300px;
        font-size: 40px;
    }
}

.Live .CHRONO, .MOYENNE {
    display: flex;
    position: relative;
    height: 200px;
    overflow: hidden;
}

.Live .CHRONO, .Live .MOYENNE, .Live .Classement {
    width: 90%;
}

/* Style pour le numéro */
.Live .CHRONO > div:nth-child(1) {
    font-size: 125px;
    font-weight: bold;
    line-height: 170px;
    width: 20%;
    background: #000000;
    color: #ffffff;
}

.Live .CHRONO > div:nth-child(1) > div:nth-child(1) {
    height: 85%;
}

.Live .CHRONO > div:nth-child(1) > div:nth-child(2) {
    font-size: 18px;
    height: 15%;
    line-height: 30px;
}

/* Affichage Coureur */
.Live .CHRONO > div:nth-child(2) {
    position: absolute;
    right: 0px;
    top: 0px;
    display: flex;
    width: 80%;
    height: 55%;
    background: #407392;
    color: #ffffff;
    font-size: 18px;
}

.Live .CHRONO > div:nth-child(2) div {
    width: 50%;
}

.Live .CHRONO > div:nth-child(2) > div > div {
    width: 100%;
}

/* Conteneur des temps */
.Live .CHRONO > div:nth-child(3) {
    position: absolute;
    right: 0px;
    bottom: 0px;
    height: 45%;
    display: flex;
    width: 80%;
    background: #000000;
    color: #ffffff;
}

.Live .CHRONO > div:nth-child(3) div {
    width: 50%;
}

.Live .Classement tbody tr td {
    padding: 2px;
    font-size: 18px;
}

.Live .MOYENNE {
    font-size: 40px;
    height: 100px;
}

.Live .MOYENNE div{
    width: 50%;
}

.Live .MOYENNE div div{
    width: 100%;
}


.S101 {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.S101 table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.S101 th, .S101 td {
    border: 1px solid #ccc;
    text-align: center;
    padding: 5px;
}

.S101 th {
    background-color: #f0f0f0;
    font-weight: bold;
}

.S101 .input-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.S101 .button-group {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}


.S102 {
    margin: 0;
    padding: 0;
    display: flex;
    color: #333;
}

.S102 .searchable-table {
    width: 100%;
}

.S102 input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
}

/* Responsiveness */
@media (max-width: 768px) {
    .S102 {
        flex-direction: column;
    }
}

.Grille {
    width: 100%;
    border-collapse: collapse;
}
.Grille td {
    border: 1px solid black;
}
.Grille .equipe {
    font-weight: bold;
    font-size: 12px;
    width: 20%;
}
.Grille .split-vertical {
    display: flex;
    flex-direction: column;
}
.Grille .split-vertical div:last-child {
    border-bottom: none;
}
.Grille .doss {
    width: 100%;
    text-align: center;
    font-weight: bold;
    font-size: 20px;
}
.Grille .nom {
    font-size: 7px;
}







/*///CSS GENERAL///*/

#form {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    align-content: flex-start;
}

#form .section {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    padding: 10px;
    width: 300px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #407392;
}

h1 {
    width: 90%;
    background-color: #d1d1d1;
    margin-inline: 5%;
    margin-top: 5px;
    font-family: 'Segoe UI', 'Calibri', 'Helvetica Neue', sans-serif;
    font-size: 25px;
    font-weight: bolder;
    text-align: center;
    border-top: 6px solid;
    border-bottom: 6px solid;
    border-color: #407392;
}

h2 {
    background-color: #d1d1d1;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    border-bottom: 4px solid #407392;
    margin-bottom: 10px;
}

.hidden {
    display: none !important;
}

.alert {
    padding: 10px;
    margin-bottom: 15px;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 18px;
}

.success-message {
    padding: 10px;
    margin-bottom: 15px;
    color: black;
    background-color: #28a745;
    border: 1px solid #28a745;
    border-radius: 4px;
    font-size: 18px;
}
.error-message {
    color: red;
    font-size: 0.9em;
}

.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 350px;
    max-height: 80vh;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.flag-popup {
    width: 30px;
    height: 22px;
    display: inline-block;
    margin-left: 5px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #aaa;
}

.close-btn:hover {
    color: #000;
}

@media (max-width: 400px) {
    .popup-content {
        width: 300px;
    }
}

#fileManagerPopup #fileList {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
}
#fileManagerPopup .fileItem {
    position: relative;
}
#fileManagerPopup .fileItem img {
    max-width: 100%;
    max-height: 80px;
    object-fit: cover;
    cursor: pointer;
}
#fileManagerPopup .fileItem button {
    position: absolute;
    top: 0;
    right: 0;
    background: red;
    color: white;
    border: none;
    font-size: 12px;
    padding: 2px 5px;
    cursor: pointer;
}

/*FORMULAIRE*/

#main input,
#main select,
#main textarea {
    width: 100%;
    padding: 5px;
    font-size: 14px;
    margin-bottom: 10px;
    border: 1px solid #407392;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1em;
    background-color: #f5faff;
    color: #333;
    transition: border-color 0.3s ease;
}

#main input:hover,
#main select:hover,
#main textarea:hover {
    border: 2px solid black;
}

#main input[type="button"],
#main input[type="submit"] {
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
    background-color: #407392;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#main input[type="submit"]:hover,
#main input[type="button"]:hover {
    background-color: black;
}

.menuGauche {
    width: 40%;
    background-color: #cfe2f3; /* Bleu clair */
    color: #333;
    border-right: 2px solid #a2c4c9; /* Gris pastel */
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    border-radius: 0 10px 10px 0;
}

@media (max-width: 768px) {
    .menuGauche {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #a2c4c9;
    }
}

/* Loader */
    #loader {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
    }

    #loader .spinner {
        width: 60px;
        height: 60px;
        border: 6px solid #f3f3f3;
        border-top: 6px solid #407392;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

/* Switch */
    .switch-container {
        text-align: right;
        padding-right: 5%;
    }

    .switch-label {
        display: inline-block;
        vertical-align: middle;
        margin-right: 10px;
    }

    .switch {
        display: inline-block;
        width: 50px;
        height: 30px;
        position: relative;
    }

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .switch .slider {
        position: absolute;
        cursor: pointer;
        top: 0; left: 0; right: 0; bottom: 0;
        background: #ccc;
        transition: background 0.4s;
        border-radius: 28px;
    }

    .switch .slider:before {
        position: absolute;
        content: "";
        height: 24px; width: 24px;
        left: 3px; bottom: 3px;
        background-color: white;
        transition: transform 0.4s;
        border-radius: 50%;
    }

    .switch input:checked + .slider {
        background: #407392;
    }

    .switch input:checked + .slider:before {
        transform: translateX(20px);
    }

/* Footer Global Style */
    footer {
        background-color: #407392;
        color: white;
        padding: 30px 20px;
        font-family: 'Roboto', Arial, sans-serif;
        margin-top: auto;
    }

    .footer-bottom {
        margin-top: 30px;
        text-align: center;
        font-size: 14px;
        border-top: 1px solid #eeeeee;
        padding-top: 10px;
    }
