/*-----------------------------------------------------------------------------
Structure générale de la page (responsive)
-----------------------------------------------------------------------------*/
body {
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #E8EDED;
    color: #1F2A38;
}

#header {
    width: 100%;
    display: flex;
}

.content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

aside {
    width: 40rem;
    overflow-y: scroll;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 3rem);
}

article {
    flex-shrink: 0;
}

.main-content {
    flex: 1;
}

/* Styles pour mobile */
@media (max-width: 768px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .content, #homepage #utilisateurs {
        flex-direction: column;
        overflow: visible;
        min-height: auto;
        flex: none;
    }

    aside {
        width: auto;
        height: auto;
        overflow: visible;
    }

    .main-content {
        min-height: 50vh;
        width: 100%;
    }

    .header {
        justify-content: center!important;
        flex-direction: column;
    }
}

/*-----------------------------------------------------------------------------
Bandeau de titre toujours affiché en haut
-----------------------------------------------------------------------------*/

.header {
    background-color: #2C3E50;
    justify-content: space-between;
    padding: 0.2rem 0.7rem;
    align-items: center;
}

#header a {
    text-decoration: none;
}

#header h1 {
    color: #E8EDED;
    font-size: 1.7rem;
    margin: 0;
    font-style: italic;
}


/*-----------------------------------------------------------------------------
Carte interactive
-----------------------------------------------------------------------------*/
#map {
    flex-grow: 1; /* Prend toute la hauteur restante */
    display: flex;
    align-items: center;
    justify-content: center;
}

#map .leaflet-popup .leaflet-popup-content-wrapper,
#map .leaflet-popup .leaflet-popup-tip {
    background-color: #D0DDD6;
    border-radius: 0;
    border: 1px solid #2C3E50;
    padding: 0;
}

#map .leaflet-popup .leaflet-popup-content {
    margin: 0;
}

#map .leaflet-popup .leaflet-popup-content .nom-piste {
    padding: 0.5rem;
}

#map .leaflet-popup .leaflet-popup-content .details-piste {
    padding: 0.3rem 0.5rem 0.5rem;
}

#map .marker-precisions {
    font-size: 20px;
}

/*-----------------------------------------------------------------------------
Les articles
-----------------------------------------------------------------------------*/
article.texte {
    border-top: 2px solid #D0DDD6;
    padding: 0.7rem;
}

article.titre {
    text-align: center;
}

article.nom-domaine {
    background-color: #D0DDD6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
}

article.nom-domaine img {
    width: 3rem;
    border-radius: 50%;
    margin-right: 0.5rem;
}

article#image img {
    max-width: 100%;
    height: auto;
    display: block;
}

article #info-pourcentage {
    display: flex;
    justify-content: space-between;
    padding: 0.7rem 0;
}

article #info-pourcentage span#date-dernier-damage {
    white-space: nowrap;
}

article #info-pourcentage span#longueur-totale {
    white-space: nowrap;
}

article#message-damage {
    background-color: antiquewhite;
    text-align: center;
}

article#bulletin p {
    padding: 1rem 0;
}

article#enregistrement-trajet-dameuse {
    text-align: center;
}

article#enregistrement-trajet-dameuse button#enregistreur {
    border: 2px solid #1F2A38;
    border-radius: 20%;
    cursor: pointer;
}

article#enregistrement-trajet-dameuse button#enregistreur .icon {
    width: 4rem;
    height: 3rem;

}

article#synchronisation-trajet-dameuse {
    text-align: center;
}

article#synchronisation-trajet-dameuse #erreurs{
    width: 100%;
    background-color: #DDD;
    margin: 2rem 0;
    text-align: left;
}

.selections {
    background-color: #D0DDD6;
    display: flex;
    align-items: center;
    padding: 0.4rem;
}

#selections > span {
    border: 1px solid #2C3E50;
    padding: 0.2rem 0.3rem;
    margin: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    cursor: pointer;
    font-weight: bold;
}

#selections > span.sélectionné {
    background-color: #2C3E50;
    color: #E8EDED;
}

#sections #bulletin,
#sections #description,
#sections #horaires
{
    padding: 0.7rem
}

#sections #bulletin #contenu-dernier-bulletin {
    margin-top: 1rem;
}
/* Styles pour mobile */
@media (max-width: 768px) {
    /* Pour avoir la place de scroller vers le haut pour remonter */
    #sections #webcam {
        padding-bottom: 2rem;
    }
}

#sections #webcam {
    background-color: #D0DDD6;
}

#sections #webcam iframe {
    border: none;
    overflow: hidden;
    width: 100%;
    height: 30rem;
}

/*-----------------------------------------------------------------------------
Barre de pourcentage des pistes damées
-----------------------------------------------------------------------------*/
#barre-pourcentage {
}

#barre-pourcentage .bar-container {
    display: flex;
    width: 100%;
    border: 1px solid #1F2A38;
    border-radius: 0.5rem;
    overflow: hidden;
}
#barre-pourcentage .bar {
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
}
#barre-pourcentage .labels {
    display: flex;
    width: 100%;
}
#barre-pourcentage .label {
    text-align: center;
    color: white;
}

/*-----------------------------------------------------------------------------
Couleurs des différents états des pistes.
-----------------------------------------------------------------------------*/
.couleur-damage-moins-24h,
#map .leaflet-popup.couleur-damage-moins-24h .leaflet-popup-tip {
    background-color: #6AB547FF;
}

.couleur-damage-1-3-jours,
#map .leaflet-popup.couleur-damage-1-3-jours .leaflet-popup-tip {
    background-color: #FEC01EFF;
}

.couleur-damage-4-6-jours,
#map .leaflet-popup.couleur-damage-4-6-jours .leaflet-popup-tip {
    background-color: #EE7000FF;
}

.couleur-damage-une-semaine-ou-plus,
#map .leaflet-popup.couleur-damage-une-semaine-ou-plus .leaflet-popup-tip {
    background-color: #EE2D00FF;
}

.couleur-damage-aucun-damage,
#map .leaflet-popup.couleur-damage-aucun-damage .leaflet-popup-tip {
    background-color: #494650FF;
    color: #E8EDED!important;
}

.couleur-damage-fermée,
#map .leaflet-popup.couleur-damage-fermée .leaflet-popup-tip {
    background-color: #9996A0FF;
    color: #E8EDED!important;
}

/*-----------------------------------------------------------------------------
Petit indicateur de la difficulté de piste
-----------------------------------------------------------------------------*/
.couleur-piste {
    position: relative;
    padding-left: 1.2rem;
}

.couleur-piste::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    transform: translateY(-50%);
    width: 0.7rem;
    height: 0.7rem;
}

.piste-F::before {
    background-color: #6ab547;
    border: 1px none;
    border-radius: 50%;
}

.piste-PD::before {
    background-color: #0077EE;
    border: 1px none;
    border-radius: 50%;
}

.piste-AD::before {
    background-color: #ee2c00;
    border: 1px none;
    border-radius: 50%;
}

.piste-D::before {
    background-color: #333;
    border: 1px solid #AAB;
    border-radius: 50%;
}

/*-----------------------------------------------------------------------------
Page principale de présentation
-----------------------------------------------------------------------------*/
body#homepage {
    display: block;
    overflow: visible;
}

#homepage .content {
    display: block;
}

#homepage h2 {
    line-height: 2.2rem;
    font-size: 2rem;
    margin: 1rem;
}

#homepage .zone-simple {
    text-align: center;
    margin: 2rem;
}

#homepage .zone-simple select {
    margin: 1rem;
}

#homepage #utilisateurs {
    display: flex;
}

#homepage #utilisateurs div.type-utilisateurs {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 2rem;
    background-color: #D0DDD6;
}

#homepage #utilisateurs div.type-utilisateurs.gestionnaire {
    background-color: #D0D6DD;
}

#homepage #utilisateurs div.type-utilisateurs.gestionnaire #demande-renseignements {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

#homepage #utilisateurs div.type-utilisateurs.gestionnaire #demande-renseignements a {
    border: 1px solid #2C3E50;
    padding: 0.5rem 0.8rem;
    border-radius: 0.7rem;
    background-color: #2C3E50;
    color: #E8EDED;
    text-decoration: none;
}

#homepage #utilisateurs div h3,
#homepage #utilisateurs div p {
    display: flex;
    justify-content: center;
}

#homepage #utilisateurs div p {
    margin: 1rem 0 1.5rem;
}

#homepage #utilisateurs div#visualisation-domaine {
    display: flex;
    flex-direction: column;
    margin-top: 2rem;
    padding: 1rem 2rem;
    border-radius: 1rem;
    background-color: #2C3E50;
    color: #E8EDED;
}

#homepage #utilisateurs div#visualisation-domaine select {
    border: none;
    margin: 0.7rem 0 0.3rem;
}

#homepage footer {
    text-align: center;
    background-color: white;
    color: #555;
    padding: 0.5rem;
    font-size: 0.9rem;
}

/*-----------------------------------------------------------------------------
Pages d'administration : on surcharge pour revenir en display block de partout.
-----------------------------------------------------------------------------*/
body#admin {
    margin: 0;
    height: auto;
    display: block;
    overflow: visible;
    background-color: #E8EDED;
    color: #1F2A38;
}

#admin .content {
    display: block;
}

#admin .zone-simple {
    margin: 1rem;
}

#admin .selection-domaine {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1rem;
    background-color: #D0D6DD;
    width: fit-content;
    padding: 2rem;
    border-radius: 0.7rem;
}

#admin .selection-domaine a {
    color: #1F2A38;
    text-decoration: none;
}

#admin h3 {
    margin-bottom: 1rem;
}

#admin p {
    margin-bottom: 0.7rem;
}

#admin .nom-domaine {
    background-color: #D0DDD6;
    text-align: center;
}

#admin textarea {
    display: block;
    width: 20rem;
    margin-bottom: 1rem;
    height: auto;
}

#admin #menu-admin {
    margin: 0.3rem 0;
    color: #1F2A38;
}

#admin #connexion input {
    display: block;
    margin-bottom: 1rem;
}

#admin button {
    margin: 1rem 0;
    color: #1F2A38;
}

#admin #dernierBulletin {
    margin: 1rem;
}

#admin #dernierBulletin #contenuDernierBulletin {
    border: 1px solid #2C3E50;
    background-color: white;
    margin: 1rem 0;
    padding: 0.3rem;
    width: 20rem;
    text-align: left;
}

#admin table {
    border: none;
}

#admin table tbody tr:nth-child(odd) {
    background-color: #D0DDD6;
}

#admin table td {
    padding: 0.2rem 0.5rem;
}

#admin table td.checkbox {
    text-align: center;
}

#admin table input[type=datetime-local] {
    width: 14rem;
}

#admin table td a.raccourci {
    border: 1px solid #2C3E50;
    border-radius: 0.3rem;
    padding: 0.2rem;
    margin-left : 0.3rem;
    text-wrap: nowrap;
    cursor: pointer;
}

#admin .partage {
    background-color: #D0D6DD;
    border-radius: 0.4rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    width: fit-content;
}

#admin .partage > span {
    display: block;
    font-weight: bold;
    margin-bottom: 1rem;
}

#admin .partage > button {
    display: block;
}
