/*Reset CSS*/
* {
    margin: 0px;
    padding: 0px;
    font-family: Avenir, sans-serif;
}

nav {
    width: 100%;
    margin: 0 auto;
    background-color: white;
    position: sticky;
    top: 0px;
    overflow: visible !important;
    z-index: 2000;
}

nav ul {
    list-style-type: none;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

nav ul li {
    /* float: left; */
    width: auto;
    min-width: 250px; /* Augmenté de 180px à 250px */
    text-align: center;
    position: relative;
    margin: 0 10px;
}

nav ul::after {
    content: "";
    display: table;
    clear: both;
}

nav a {
    display: block;
    text-decoration: none;
    color: black;
    border-bottom: 2px solid transparent;
    padding: 10px 0px;
}

nav a:hover {
    color: rgb(0, 47, 255);
    border-bottom: 2px solid rgb(0, 170, 255);
}

nav > ul > li > a {
    font-size: 14px;
}

.sous {
    display: none;
    box-shadow: 0px 1px 2px #ccc;
    background-color: white;
    position: absolute;
    min-width: 300px; /* Augmenté pour les textes longs */
    width: max-content; /* S'adapte au contenu */
    max-width: 90vw; /* Limite la largeur à 90% de l'écran */
    left: 0;
    top: 100%;
    z-index: 3000 !important;
    max-height: 300px;
    overflow-y: auto;
    white-space: nowrap; /* Empêche le retour à la ligne */
}

nav>ul li:hover .sous {
    display: block;
}

.sous li {
    float: none;
    width: 100%;
    text-align: left;
}

.sous a {
    padding: 10px;
    border-bottom: none;
}

.sous a:hover {
    border-bottom: none;
    background-color: RGBa(200, 200, 200, 0.1);
}

.sous li, .sous label, .sous input {
    font-size: 12px !important;
}

.deroulant>a::after {
    content: " ▼";
    font-size: 12px;
}

.conteneur {
    margin: 50px 20px;
    height: 1500px;
}

.menu-item {
    display: flex;
    align-items: center; /* Alignement horizontal des cases et labels */
    margin: 5px 0; /* Espacement entre les éléments */
    white-space: nowrap; /* Empêche le retour à la ligne */
    min-width: max-content; /* S'adapte au contenu */
}

.menu-item label {
    margin-left: 6px;
    white-space: nowrap; /* Empêche le retour à la ligne */
    overflow: visible; /* Assure que le texte reste visible */
}

#diagram-container {
        width: 96vw;
        max-width: 100vw;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        padding: 20px 0;
        border: 2px solid #ddd;
        border-radius: 5px;
        box-sizing: border-box;
        background: #fff;
    }
    
#order-select {
    margin: 10px;
    padding: 5px;
    border-radius: 3px;
    border: 1px solid #ccc;
}

svg {
    display: block;
    margin: 0 auto;
}

/* Règles robustes pour forcer la visibilité des labels - Problème serveur WordPress */
svg text {
    visibility: visible !important;
    opacity: 1 !important;
    fill: #000 !important;
    font-size: 12px !important;
    font-family: sans-serif !important;
    pointer-events: all !important;
    display: block !important;
}

/* Forcer la visibilité des groupes */
svg g {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

/* Empêcher les transitions qui pourraient masquer les éléments */
svg * {
    transition: none !important;
    animation: none !important;
}

/* Style spécifique pour les interactions - maintenir la visibilité */
svg text:hover {
    font-weight: bold !important;
    fill: #000 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Forcer l'affichage des rectangles d'interaction */
svg rect {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

/* Optimisation pour réduire la charge sur le serveur */
#diagram-container {
    contain: layout style paint;
    will-change: auto;
}
