/* -----------------------------------------
----                                    ----
----  STYLES COMMUNS (MOBILE & PC)      ----
----                                    ----
--------------------------------------------
*/

/* Styles pour les messages de succès et d'erreur */
.alertSuccess {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    margin: 20px auto;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    text-align: center;
    max-width: 800px;
}

.alertError {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    margin: 20px auto;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    text-align: center;
    max-width: 800px;
}

.site-item-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
}

.site-item {
    width: 100%;
    background-color: #0e1c274d;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgb(0 13 16 / 64%);
    display: flex;
    align-items: center; /* Centre verticalement le logo et le contenu */
}

.site-logo {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    background-color: #f0f0f0;
}

.site-logo-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10%;
}

.site-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-left: 10px;
    height: 80px;
}

.site-info-top {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 50%;
    padding-top: 5px;
}

.site-info-top h2 {
    font-size: 1.2em;
    margin: 0;
}

.site-info-bottom {
    flex-grow: 1;
    display: flex;
    flex-direction: row;
    justify-content: center;
    text-align: left;
    height: 50%;
}

.site-contact-info {
    flex-grow: 10;
    display: flex;
    flex-direction: column;
    justify-content: end;
    text-align: left;
    padding-bottom: 5px;
}

.site-contact-info p {
    font-size: 0.9em;
    margin: 0;
    color: #000000;
    font-weight: bold;
}

.site-icons-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: baseline;
    justify-content: end;
}

.icon {
    height: 50px;
    width: 40px;
}

/* --------------------------------------------
----                                       ----
----  EN MODE DE FONCTIONNEMENT TELEPHONE  ----
----                                       ----
-----------------------------------------------
*/

@media screen and (max-width:767.98px) {

    /* Styles pour le corps de la page */
    body {
        display: flex;
        flex-direction: column;
        height: 100vh;
        margin: 0;
    }

   
    /* Styles pour la barre de navigation (header) */
    .header-content-mobile {
        position: sticky;
        top: 0;
        z-index: 10;
        /* Ajoutez d'autres styles pour votre en-tête ici */
    }

    /* Styles pour le contenu principal défilable */
    .main-content {
        flex-grow: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px 10px;
       
    }

    .site-list {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 10px; /* Applique un padding de 10px sur les 4 côtés */
        /* Ajoute un espace en bas de la liste pour que le dernier élément ne soit pas caché par le bouton flottant */
        padding-bottom: 140px;
    }

    .site-item-container {
        /* La div principale (rouge) */
        /* border: solid red; */
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 100%;
        max-width: 600px;
    }

    .site-item {
        width: 100%;
        background-color: #0e1c274d;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgb(0 13 16 / 64%);
        padding: 10px;
        min-width: 350px;
        /* AJOUT : Transformer la carte en conteneur flex */
        display: flex;
        align-items: center; /* Centre verticalement le logo et le contenu */
    }

    .site-logo {
        flex-shrink: 0;
        width: 80px;
        height: 80px;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 10px;
        background-color: #f0f0f0;
        /* Div gauche (verte) */
        /* border: solid green; */
    }

    .site-content {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        margin-left: 10px;
        height: 80px;
        /* Div droite (verte) */
        /* border: solid green; */
    }

    .site-logo-image {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        border-radius: 10%;
    }

    .site-info-top {
        /* Div nom du site (violet) */
        /* border: solid darkviolet; */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        height: 50%;
        padding-top: 5px;
    }

    .site-info-top h2 {
        font-size: 1.2em;
        margin: 0;
    }

    .site-info-bottom {
        /* div qui contient le nom du resp et tel (violet)*/
        /* border: solid darkviolet; */
        /* Prend tout l'espace disponible (flex-grow: 1) et aligne le texte à gauche */
        flex-grow: 1;
        display: flex;
        flex-direction: row;
        justify-content: center;
        text-align: left;
        height: 50%;
    }

    .site-contact-info {
        /* div qui contient le nom du resp et tel (orange)*/
        /* border: solid orange; */
        /* Prend tout l'espace disponible (flex-grow: 1) et aligne le texte à gauche */
        flex-grow: 10;
        display: flex;
        flex-direction: column;
        justify-content: end;
        text-align: left;
        padding-bottom: 5px;
    }

    .site-contact-info p {
        font-size: 0.9em;
        margin: 0;
        color: #000000;
        font-weight: bold; /* Ajout pour mettre le texte en gras */
    }

    .site-icons-container {
        /* Div qui contient les deux icones (orange) */
        /* border: solid orange; */
        display: flex;
        flex-direction: row;
        gap: 15px;
        align-items: baseline;
        justify-content: end;
    }

    .icon-wrapper {
        /* Divs pour chaque icône (jaune) */
        /* border: solid yellow; */
    }

    .icon {
        height: 50px;
        width: 40px;
    }

    .add-button-container {
        position: fixed;
        bottom: 25px;
        right: 25px;
        z-index: 1000;
    }

    .add-button {
        display: block;
        width: 60px;
        height: 60px;
        background-color: #478ac9;
        color: white;
        text-align: center;
        font-size: 4em;
        line-height: 60px; /* Centre le '+' verticalement */
        border-radius: 30%; 
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        text-decoration: none;
    }

}    

/* -----------------------------------------
----                                    ----
----  EN MODE DE FONCTIONNEMENT PC      ----
----                                    ----
--------------------------------------------
*/

@media screen and (min-width:768px) {
    .liste-site-container {
        position: relative;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .site-list {
        position: relative; /* Ajout pour positionner le bouton par rapport à la liste */
        /* border: solid red; */
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); /* Crée une grille adaptative */
        gap: 30px;
        justify-content: center;
        align-items: start; 
        width: 100%; /* S'assure que la fiche occupe toute la largeur de sa colonne */
        margin: 0;
        padding: 20px;
        max-width: 1000px;
    
    }



    .site-item-container {
         /* La div de chaque item(bleue) */
        /* border: solid blue; */
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 100%;
        max-width: 400px;
    }

    .site-item {
      
        width: 100%;
        background-color: #0e1c274d;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgb(0 13 16 / 64%);
        padding: 15px;
        min-width: 400px;
        /* AJOUT : Transformer la carte en conteneur flex */
        display: flex;
        align-items: center; /* Centre verticalement le logo et le contenu */
       
    }
   
     .site-content {
         /* Div droite (verte) */
        /* border: solid green; */
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        margin-left: 10px;
        height: 80px;
       
    }


      .site-logo {
            /* Div gauche (verte) */
        /* border: solid green; */
        flex-shrink: 0;
        width: 80px;
        height: 80px;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 10px;
        background-color: #f0f0f0;
    
    }

    .site-logo-image {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        border-radius: 10%;
    }

       .site-info-top {
        /* Div nom du site (violet) */
        /* border: solid darkviolet; */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        height: 50%;
        padding-top: 5px;
    }

    .site-info-top h2 {
        font-size: 1.2em;
        margin: 0;
    }

    .site-info-bottom {
        /* div qui contient le nom du resp et tel (violet)*/
        /* border: solid darkviolet; */
        /* Prend tout l'espace disponible (flex-grow: 1) et aligne le texte à gauche */
        flex-grow: 1;
        display: flex;
        flex-direction: row;
        justify-content: center;
        text-align: left;
        height: 50%;
    }
     .site-contact-info {
        /* div qui contient le nom du resp et tel (orange)*/
        /* border: solid orange; */
        /* Prend tout l'espace disponible (flex-grow: 1) et aligne le texte à gauche */
        flex-grow: 10;
        display: flex;
        flex-direction: column;
        justify-content: end;
        text-align: left;
        padding-bottom: 5px;
    }

    .site-contact-info p {
        font-size: 0.9em;
        margin: 0;
        color: #000000;
        font-weight: bold; /* Ajout pour mettre le texte en gras */
    }

    .site-icons-container {
        /* Div qui contient les deux icones (orange) */
        /* border: solid orange; */
        display: flex;
        flex-direction: row;
        gap: 15px;
        align-items: baseline;
        justify-content: end;
    }

    .icon-wrapper {
        /* Divs pour chaque icône (jaune) */
        /* border: solid yellow; */
    }

    .icon {
        height: 50px;
        width: 40px;
    }

    .add-button-container {
        position: absolute; /* Positionné par rapport à .site-list */
        top: 20px; /* La même que le padding de .site-list */
        right: -85px; /* Décale le bouton à l'extérieur de la liste, sur la droite */
    }

    .add-button {
        display: block;
        width: 60px;
        height: 60px;
        background-color: #478ac9;
        color: white;
        text-align: center; 
        font-size: 4em;
        line-height: 60px;
        border-radius: 30%;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        text-decoration: none;
    }
           
     
         
}

/* =================================== */
/* STYLES MODALE CONFIRMATION GENERIQUE */
/* =================================== */

#genericConfirmationModal {
    display: none; /* Caché par défaut */
    position: fixed;
    z-index: 2000; /* Au-dessus de tout le reste */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* Fond noir semi-transparent */
    backdrop-filter: blur(3px); /* Effet de flou */
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#genericConfirmationModal .modal-content {
    background-color: #ffffff; /* Fond blanc pour la lisibilité */
    margin: auto;
    padding: 25px 20px; /* Padding réduit pour mobile */
    border-radius: 12px;
    width: 85%; /* Largeur ajustée pour mobile */
    max-width: 450px; /* Max-width légèrement réduite */
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    text-align: center;
    position: relative;
    transform: scale(0.95);
    animation: zoomIn 0.3s ease-out forwards;
}

/* Media query pour les écrans plus grands */
@media (min-width: 500px) {
    #genericConfirmationModal .modal-content {
        padding: 30px 40px; /* Padding plus large sur PC */
    }

    #genericConfirmationModal .modal-btn-cancel,
    #genericConfirmationModal #confirmActionButton {
        width: auto; /* Reprend sa taille naturelle sur PC */
        min-width: 150px;
        padding: 12px 25px;
    }
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#genericConfirmationModal #modalConfirmationMessage {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.5;
}

#genericConfirmationModal #modalConfirmationMessage strong {
    color: #dc3545; /* Rouge pour le nom de l'élément */
    font-weight: 700;
}

#genericConfirmationModal .modal-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

#genericConfirmationModal .modal-btn-cancel,
#genericConfirmationModal #confirmActionButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px; /* Padding légèrement réduit pour mobile */
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    width: 100%; /* Pleine largeur sur mobile, pour qu'ils s'empilent */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#genericConfirmationModal .modal-btn-cancel:active,
#genericConfirmationModal #confirmActionButton:active {
    transform: translateY(1px);
}

#genericConfirmationModal .modal-btn-cancel {
    background-color: #6c757d;
    color: white;
    order: 1; /* Bouton "Non" à gauche */
}

#genericConfirmationModal .modal-btn-cancel:hover {
    background-color: #5a6268;
}

#genericConfirmationModal #confirmActionButton {
    background-color: #dc3545;
    color: white;
    order: 2; /* Bouton "Oui" à droite */
}

#genericConfirmationModal #confirmActionButton:hover {
    background-color: #c82333;
}
