body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #111;
    color: white;
}

/* Header principal */
header {
    background: #1c1c1c;
    padding: 0px 30px; /* 10px vertical, 30px horizontal */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #00ff88;
}

header h1 {
    margin: 0;
    color: #00ff88;
    font-size: 22px;
}

.header-right a.login-btn {
    color: #ffaa00;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid #00ff88;
    border-radius: 5px;
    transition: background 0.3s, color 0.3s;
}

.header-right a.login-btn:hover {
    background: #00ff88;
    color: #111;
}


/* Badge utilisateur header */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    /*background: #1c1c1c;
    border: 1px solid #00ff88;
    border-radius: 25px;
    font-size: 14px;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.2);*/
}

.user-name {
    /*color: #00ff88;*/
    font-weight: bold;
}

.user-role {
    background: #b7b7b7;
    color: #111;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}


/* Bloc secondaire sous le header */
.header-down {
    background: #1c1c1c;             /* meme couleur que header principal */
    padding: 15px 20px;              /* un peu moins haut que le header */
    display: flex;                   /* pour aligner les onglets sur une ligne */
    align-items: center;
    border-bottom: 2px solid #00ff88; /* separation nette */
    gap: 15px;                        /* espace entre les elements */
}

/* Liste d'onglets */
.header-down .tabs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;                   /* met les onglets sur une ligne */
    gap: 10px;                       /* espace entre chaque onglet */
}

/* Liens des onglets */
.header-down .tabs li a,
.header-down a.btn-blue {
    padding: 5px 10px;
    background-color: #774db9;       /* couleur principale des boutons */
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s, color 0.3s;
}

/* Effet au survol */
.header-down .tabs li a:hover,
.header-down a.btn-blue:hover {
    background-color: #ffaa00;       /* effet neon au survol */
    color: #111;
}


.qrcode {
    width: 80px;      /* ou 200px pour plus grand */
    height: 80px;     /* garder carre */
}







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

.form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 60px 20px;
}

.form-container form {
    background: #1c1c1c;
    padding: 40px;
    border-radius: 15px;
    border: 1px solid #00ff88;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
    text-align: center;
}

.form-container h2 {
    margin-bottom: 25px;
    color: #00ff88;
}


/* Inputs et bouton meme taille */
.form-container input,
.form-container button {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;  /* Important ! */
}

/* Inputs spécifiques */
.form-container input {
    border: 1px solid #333;
    background-color: #111;
    color: white;
    margin-bottom: 18px;
}

/* Bouton spécifique */
.form-container button {
    border: none;
    background: #00ff88;
    color: #111;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.form-container button:hover {
    background: #ffaa00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 170, 0, 0.4);
}


/*----------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------*/
/*---------------------------------------Chronometre--------------------------------------*/
/*----------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------*/



.chrono-container {
    text-align: center;
    margin: 20px 0;
}

#chrono {
    font-size: 4rem;
    font-weight: bold;
    background: #111;
    color: #ffa313;
    padding: 10px 20px;
    display: inline-block;
    border-radius: 8px;
    font-family: monospace;
}


/*----------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------*/
/*----------------------------------GPX affichage parcours--------------------------------*/
/*----------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------*/
#map{
    height:500px;
    margin-top:20px;
    border:2px solid #00ff88;
    border-radius:10px;
}
#elevation{
    margin-top:30px;
    background:#1c1c1c;
    border:2px solid #00ff88;
    border-radius:10px;
    padding:10px;
}
.gpx-card{
    background:#1c1c1c;
    padding:20px;
    border-radius:10px;
    border:1px solid #00ff88;
    margin-top:20px;
}
.btn{
    padding:8px 12px;
    border-radius:6px;
    font-weight:bold;
    text-decoration:none;
    display:inline-block;
    border:none;
    cursor:pointer;
}

#elevation .download {
    display: none !important;
}

.btn-green{background:#00ff88;color:#111;}
.btn-green:hover{background:#ffaa00;}
.btn-red{background:#ff4d4d;color:#111;}
.btn-red:hover{background:#ff1a1a;color:white;}


/*----------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------*/
/*-----------------------Formulaire ajout utilisateur specifique--------------------------*/
/*----------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------*/
/* Titre centre, fixe */
.user-management .table-title-wrapper {
    text-align: center;
    margin-bottom: 15px; /* espace sous le titre */
    background-color: #193126;
    margin: 30px auto;
    max-width: 1400px
}

.user-management .table-title {
    color: #00ff88;
    font-size: 1.5em;
    margin: 0;
}

/*-------------------- Formulaire ajout utilisateur --------------------*/
.user-management .form-container {
    background-color: #1c1c1c;
    border-radius: 10px;
    max-width: 400px;
    margin: 20px auto;
    color: #fff;
    box-shadow: 0 0 10px rgba(0,255,136,0.2);
    padding: 25px;
}

.user-management .form-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #00ff88;
}

.user-management .form-container input,
.user-management .form-container select,
.user-management .form-container button {
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #00ff88;
    background-color: #111;
    color: #fff;
    font-size: 14px;
}

.user-management .form-container input:focus,
.user-management .form-container select:focus {
    outline: none;
    border-color: #ffaa00;
}

.user-management .form-container button {
    background-color: #00ff88;
    color: #111;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.user-management .form-container button:hover {
    background-color: #ffaa00;
    color: #111;
}




/*-------------------- Tableau utilisateur --------------------*/
.user-management .table-wrapper {
    margin: 30px auto;
    max-width: 1400px;
    overflow-x: auto;
    overflow-y: auto;        /* scroll vertical si trop de lignes */
    /*background-color: #193126;*/
    max-height: 600px;       /* hauteur pour environ 10 lignes */
    padding: 0px;
    border-radius: 10px;
}

.user-management .table-wrapper thead th {
    position: sticky;     /* rend le header fixe */
    top: 0;               /* reste colle en haut du conteneur */
    background-color: #111; /* meme couleur que ton header */
    color: #00ff88;
    z-index: 10;          /* pour que le header reste au-dessus des lignes */
}


.user-management .table-wrapper h2.table-title {
    text-align: center;
    color: #00ff88;
    margin-bottom: 15px;
}

/* Table ajustable selon contenu */
.user-management .table-wrapper table {
    width: 100%;                 /* s'adapte au contenu le plus large */
    border-collapse: collapse;
    background-color: #1c1c1c;
    color: #fff;
    border-radius: 8px;
    table-layout: auto;          /* tres important pour largeur automatique */
}

/* En-tetes et cellules */
.user-management .table-wrapper th,
.user-management .table-wrapper td {
    padding: 12px 5px;
    text-align: center;
    border-bottom: 1px solid #00ff88;
    white-space: nowrap;         /* empeche le texte de casser */
}

/* En-tetes */
.user-management .table-wrapper th {
    background-color: #111;
    color: #00ff88;
}

/* Hover sur les lignes */
.user-management .table-wrapper tr:hover {
    background-color: rgba(0,255,136,0.1);
}

/* Inputs et selects dans la table */
.user-management .table-wrapper input,
.user-management .table-wrapper select {
    width: auto;                 /* s'ajuste au texte */
    min-width: 40px;             /* largeur minimum */
    max-width: 90px;            /* largeur maximum */
    padding: 5px 8px;
    border-radius: 5px;
    border: 1px solid #fdfdfd;
    background-color: #111;
    color: #fff;
    text-align: center;
}

/* Input type number specifique pour table */
.user-management .table-wrapper input[type="number"] {
    width: 3ch;          /* largeur adaptee au nombre de chiffres */
    min-width: 60px;     /* largeur minimum */
    max-width: 80px;     /* largeur maximum */
    padding: 5px 5px;
    box-sizing: border-box; /* inclut padding et border dans la largeur */
}


/* Actions boutons */
.user-management .actions-btns {
    /*display: flex;*/
    gap: 5px;
    justify-content: flex-start;
}

.user-management .actions-btns .btn-modifier {
    background-color: #00ff88;
    border: none;
    color: #111;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.user-management .actions-btns .btn-modifier:hover {
    background-color: #ffaa00;
    color: #111;
}

.user-management .actions-btns .btn-supprimer {
    background-color: #ff4d4d;
    border: none;
    color: #111;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.user-management .actions-btns .btn-supprimer:hover {
    background-color: #ff1a1a;
    color: #111;
}


/* Hauteur max pour 10 lignes (approximative, depend du padding) */
.user-management .table-body-wrapper {
    max-height: 400px;      /* ajuste selon la taille de tes lignes */
    overflow-y: auto;       /* scroll vertical uniquement */
}

/* Pour que le tableau du tbody reste aligne avec le thead */
.user-management .table-body-wrapper table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

/* Garder le style des lignes */
.user-management .table-body-wrapper th,
.user-management .table-body-wrapper td {
    padding: 12px 5px;
    text-align: center;
    border-bottom: 1px solid #00ff88;
    white-space: nowrap;
}

.user-management .table-body-wrapper tr:hover {
    background-color: rgba(0,255,136,0.1);
}



/*----------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------*/
/*-----------------------Formulaire Participant accueil--------------------------*/
/*----------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------*/

.table-scroll-wrapper {
    max-height: 500px;       /* limite a 10 lignes environ */
    overflow-y: auto;        /* scroll vertical */
    overflow-x: auto;        /* scroll horizontal si necessaire */
}

/* Table classique */
.participants-table {
    width: 100%;
    border-collapse: collapse;
}

/* Fixer le thead */
.participants-table thead th {
    position: sticky;        /* le fixe */
    top: 0;                  /* distance du top du conteneur */
    background-color: #111;  /* meme couleur que ton header */
    color: #00ff88;
    z-index: 2;              /* pour qu'il soit au-dessus des lignes */
    font-size: 25px; /* <- Augmente ici la taille du texte du header */
}

/* Cellules et style du tbody */
.participants-table th,
.participants-table td {
    padding: 10px;
    text-align: center;
    /*border: 1px solid #00ff88;*/
    white-space: nowrap;
    font-size: 25px; /* <- Augmente ici la taille du texte du header */
}

.participants-table tr:hover {
    background-color: rgba(0,255,136,0.1);
}


.status.en_attente { color: #ff9900; font-weight: bold; }
.status.en_course { color: #00ccff; font-weight: bold; }
.status.terminee { color: #00ff88; font-weight: bold; }
.status.abandon { color: #ff0000; font-weight: bold; }

.flex-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
}










h1 a.home-link {
    color: #00ff88;
    text-decoration: none;
    display: inline-flex;       /* change ici */
    align-items: center;        /* aligne verticalement */
    gap: 10px;                  /* espace logo / texte */
}


h1 a.home-link:hover {
    color: #ffaa00;       /* effet neon au survol */
}

h1 a.home-link img {
    width: 100px;     /* taille du logo */
    height: auto;
}


h1 {
    margin: 0;
    color: #00ff88;
    font-size: 1.5rem; /* plus flexible pour mobiles */
}

.info {
    display: flex;
    gap: 30px;
    font-size: 18px;
    flex-wrap: wrap; /* pour que les infos passent a la ligne sur petit ecran */
}

.container {
    padding: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    overflow-x: auto; /* permet de scroller horizontalement sur mobile */
}

th, td {
    padding: 12px;
    text-align: left;
    white-space: nowrap; /* evite le retour a la ligne dans les cellules */
}

th {
    background-color: #222;
    border-bottom: 2px solid #00ff88;
}

tr:nth-child(even) {
    background-color: #1a1a1a;
}

.status-running {
    color: #00ff88;
    font-weight: bold;
}

.status-abandon {
    color: #ff4444;
    font-weight: bold;
}

.status-waiting {
    color: #ffaa00;
    font-weight: bold;
}

.stats {
    display: flex;
    gap: 40px;
    margin-top: 30px;
    font-size: 30px;
    flex-wrap: wrap; /* pour que les cartes se repositionnent sur mobile */
}

.card {
    background: #1c1c1c;
    color: #00ff88;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #00ff88;
    flex: 1; /* cartes flexibles qui s'adaptent a l'espace disponible */
    justify-content: center; /* centre verticalement le contenu a l'interieur de la carte */
    align-items: center;     /* centre horizontalement le contenu a l'interieur de la carte */
}

.countdown {
    font-size: 24px;
    color: #ffaa00;
}


/**********************************/
/*       -Popup message       */
/**********************************/
.toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background-color: #e74c3c;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-family: Arial, sans-serif;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
}

/*affichage messsage effemere*/
.flash-message {
  padding: 10px;
  margin-top: 10px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
}

.flash-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.flash-message {
  transition: opacity 0.5s ease-out;
}


#newIdPopupContainer {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 140px;    /*Modifier espace entre popup*/
    z-index: 9999;
}

.new-popup {
    background-color: #4CAF50;
    color: white;
    padding: 15px 15px;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.new-popup.show {
    opacity: 1;
    transform: scale(2.2);  /*Modifier Taille*/
}

.popup-disqualified {
    background-color: #d32f2f;
    color: white;
    font-weight: bold;
    border: 3px solid #ff5252;
    animation: pulseRed 1s infinite alternate;
}

@keyframes pulseRed {
    from { transform: scale(2.2); }
    to   { transform: scale(2.35); }
}




/*----------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------*/
/*----------------------------------------FOOTER------------------------------------------*/
/*----------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------*/
footer {
    position: relative; /* 👈 indispensable */
    background: var(--dark);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

/* trait en verre au-dessus du footer */
footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);

    width: 100%;
    height: 2px;

    background: rgb(0 255 136);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    border-radius: 999px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

/* TOP */
.footer-top {
    margin-bottom: 20px;
}

.footer-top h3 {
   color: rgb(0 255 136);
}

.footer-logo {
    width: 80px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.footer-top p {
    font-size: 14px;
    opacity: 0.7;
}

/* RESEAUX */
.footer-social {
    margin: 15px 0;
}

.footer-social a {
    margin: 0 8px;
    display: inline-block;
}

.footer-social img {
    width: 50px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.footer-social img:hover {
    opacity: 1;
}

/* LINKS */
.footer-links {
    margin-top: 10px;
}

.footer-links a {
    display: inline-block;
    margin: 0 10px;
    font-size: 13px;
    color: white;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.footer-links a:hover {
    opacity: 1;
}

/* COPYRIGHT */
.copyright {
    margin-top: 20px;
    font-size: 12px;
    opacity: 0.5;
}




/***************************************************************************************/


@media screen and (max-width: 600px) {
        
    .participants-table th,
    .participants-table td {
        font-size: 13px;       /* plus petit sur mobile */
        padding: 6px 8px;      /* padding reduit pour tenir dans l'ecran */
    }

    .participants-table thead th {
        font-size: 13px;       /* header plus petit aussi */
    }
    
    .table-scroll-wrapper {
        max-height: 300px;     /* hauteur reduite pour mobile si besoin */
    }
    
     /* Formulaire et tableau */
    .user-management .form-container,
    .user-management .table-wrapper {
        /*width: 95%;*/
        margin: 10px auto;
    }

    /* Active le scroll horizontal proprement */
    .user-management .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* scroll fluide sur mobile */
    }

    /* Le tableau s'adapte au contenu */
    .user-management .table-wrapper table {
        width: max-content;
        min-width: 100%;
    }

    /* Cellules plus compactes */
    .user-management .table-wrapper th,
    .user-management .table-wrapper td {
        padding: 8px 10px;
        font-size: 13px;
        white-space: nowrap; /* evite que le texte casse les colonnes */
    }

    /* Inputs plus petits */
    .user-management .table-wrapper input,
    .user-management .table-wrapper select {
        font-size: 13px;
        padding: 4px 6px;
    }

    /* Boutons empiles */
    .user-management .actions-btns {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    /* Header : logo a gauche, texte centre */
    header h1 a.home-link {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    header h1 a.home-link img {
        width: 70px;      /* logo plus petit */
        height: auto;
        flex-shrink: 0;   /* ne reduit pas le logo */
    }

    header h1 a.home-link span {
        flex: 1;           /* texte prend tout l'espace restant */
        text-align: center; /* texte centre */
        white-space: nowrap; /* pas de retour a la ligne du texte */
        overflow: hidden;   /* coupe si trop long */
        text-overflow: ellipsis;
    }

    /* Header-info */
    .header-info {
        flex-direction: column;
        gap: 10px;
        font-size: 16px;
    }

    header {
        flex-direction: column;
        align-items: center;  /* centre horizontalement */
        /*gap: 10px;*/
        padding: 10px;
    }

    .header-right {
        margin-top: 10px;
        width: 100%;
        display: flex;
        justify-content: center;  /* centre les boutons */
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Onglets / header-down */
    .header-down {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .header-down .tabs {
        gap: 20px;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-down .tabs li a,
    .header-down a.btn-blue {
        width: auto;       /* laisse le texte prendre sa taille */
        min-width: 90px;
        text-align: center;
        white-space: nowrap;
    }

    /* Tableau responsive */
    table {
        /*display: block;*/
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    /* Inputs et select dans le tableau */
    .user-management .table-wrapper input,
    .user-management .table-wrapper select {
        width: 100%;       /* prend toute la cellule */
        box-sizing: border-box;
        font-size: 14px;
        padding: 5px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .stats {
        gap: 20px;
        font-size: 16px;
    }

    .countdown {
        font-size: 20px;
    }

    .form-container form {
        padding: 20px;
    }

    .form-container input,
    .form-container select,
    .form-container button {
        font-size: 14px;
    }

    footer h3 {
        font-size: 18px;
    }

    footer p {
        font-size: 13px;
    }

    footer ul li {
        display: block;
        margin: 5px 0;
    }

    footer {
        padding: 15px;
        font-size: 14px;
    }
}

