/* -----------------------------------------
----                                    ----
----  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: stretch;
    min-height: 110px;
    box-sizing: border-box;
}

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

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

.site-content {
    flex-grow: 1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    margin-left: 10px;
    min-width: 0;
    align-self: stretch;
}

.site-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 80px;
    align-self: center;
}

.site-info-top {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: auto;
    padding-top: 0;
    margin-bottom: 4px;
}

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

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

.site-contact-info {
    flex-grow: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: left;
    padding-bottom: 0;
    margin-top: auto;
}

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

.site-icons-container {
    display: flex;
    flex-direction: row;
    flex: 0 0 auto;
    gap: 18px;
    align-items: flex-end;
    justify-content: flex-end;
    height: auto;
    margin-top: 0;
    padding-right: 4px;
    padding-bottom: 0;
    align-self: flex-end;
}

.site-listing-trigger {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    margin-top: 0;
    margin-right: 2px;
    margin-bottom: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    align-self: auto;
}

.site-mobile-actions {
    display: none;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 15px;
    align-self: center;
    margin-right: 2px;
}

.site-repertoire-trigger,
.site-listing-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 36px;
    height: 36px;
    padding: 0;
    line-height: 0;
}

.site-repertoire-trigger {
    text-decoration: none;
}

.site-listing-trigger .listing-icon,
.site-repertoire-trigger .repertoire-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    object-position: left center;
}

.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.icon-wrapper-disabled,
.site-repertoire-trigger-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.icon {
    height: 60px;
    width: 46px;
    object-fit: contain;
}

/* Popup choix listing (mobile) */
.site-listing-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.site-listing-modal.is-open {
    display: flex;
}

.site-listing-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.site-listing-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 16px;
    padding: 22px 18px 24px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.site-listing-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 1.8rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
}

.site-listing-modal-dialog h3 {
    margin: 0 0 6px;
    color: #1f2937;
    font-size: 1.15rem;
}

.site-listing-modal-site {
    margin: 0 0 18px;
    color: #4f46e5;
    font-weight: 700;
}

.site-listing-modal-icons {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    gap: 10px;
}

.site-listing-choice {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 6px;
    border-radius: 12px;
    background: #f3f4f6;
}

.site-listing-choice:hover,
.site-listing-choice:active {
    background: #e5e7eb;
}

.site-listing-choice .icon {
    width: 56px;
    height: 56px;
}

/* --------------------------------------------
----                                       ----
----  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: 5px 12px;
        min-width: 350px;
        min-height: 110px;
        display: flex;
        align-items: stretch;
        box-sizing: border-box;
    }

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

    .site-content {
        flex-grow: 1;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        justify-content: space-between;
        margin-left: 10px;
        min-width: 0;
        align-self: stretch;
    }

    .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-desktop {
        display: none !important;
    }

    .site-mobile-actions {
        display: flex;
    }

    .site-mobile-actions .icon {
        width: 36px;
        height: 36px;
        object-position: left center;
    }

    .site-listing-trigger {
        display: inline-flex;
        margin-right: 0;
    }

    .site-icons-container {
        display: none;
    }

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

    .icon {
        height: 60px;
        width: 46px;
        object-fit: contain;
    }

    .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 */
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
        gap: 24px;
        justify-content: center;
        align-items: start;
        width: 100%;
        margin: 0 auto;
        padding: 20px;
        max-width: 1600px;
        box-sizing: border-box;
    }

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

    .site-item {
        width: 100%;
        background-color: #0e1c274d;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgb(0 13 16 / 64%);
        padding: 5px 12px;
        min-width: 0;
        min-height: 140px;
        display: flex;
        align-items: stretch;
        box-sizing: border-box;
    }

     .site-content {
        flex-grow: 1;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        justify-content: space-between;
        margin-left: 14px;
        min-width: 0;
        align-self: stretch;
    }


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

    .site-text {
        height: 96px;
        align-self: center;
        justify-content: flex-start;
    }

    .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.3em;
        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.95em;
        margin: 0;
        color: #000000;
        font-weight: bold; /* Ajout pour mettre le texte en gras */
    }

    .site-icons-desktop {
        display: flex !important;
        gap: 15px;
        height: auto !important;
        margin-top: 0 !important;
        align-items: flex-end;
        align-self: flex-end;
        flex-shrink: 0;
        padding-bottom: 10px;
    }

    .site-mobile-actions {
        display: none !important;
    }

    .site-listing-trigger {
        display: none !important;
    }

    .site-icons-container {
        display: flex;
        flex-direction: row;
        gap: 15px;
        align-items: flex-end;
        justify-content: end;
        height: auto !important;
        margin-top: 0 !important;
        padding-bottom: 10px;
        align-self: flex-end;
        flex-shrink: 0;
    }

    .icon-wrapper {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .icon {
        height: 40px;
        width: 40px;
        object-fit: contain;
    }

    .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;
}
