/* Tooltips pour les menu items de la sidebar */
.menu-item {
    position: relative;
    overflow: visible !important;
    z-index: 1; /* Base z-index */
}

/* Au survol, augmenter le z-index du menu-item */
.menu-item:hover {
    z-index: 9999 !important; /* Mettre au premier plan lors du survol */
}

.menu-tooltip {
    /* Positionnement et dimensions */
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 15px;
    
    /* Style visuel */
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(30, 30, 30, 0.95) 100%);
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* Animation et visibilité */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999 !important; /* Z-index très élevé pour passer au-dessus de tout */
    
    /* Largeur pour les textes longs */
    min-width: 200px;
    max-width: 280px;
    white-space: normal;
}

/* Affichage au survol */
.menu-item:hover .menu-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(5px);
}

/* Flèche pointant vers le menu item */
.menu-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 8px 6px 0;
    border-color: transparent rgba(0, 0, 0, 0.95) transparent transparent;
    z-index: 99999;
}

/* Ajustements pour la sidebar et ses sections */
.sidebar {
    overflow: visible !important;
    z-index: 10000; /* Z-index de base pour la sidebar */
}

.sidebar .menu-section {
    position: relative;
    overflow: visible !important;
    z-index: inherit;
}

/* S'assurer que les autres éléments ne bloquent pas */
.main-content {
    z-index: 1; /* Plus bas que les tooltips */
}

.header {
    
    z-index: 1; /* Plus bas que les tooltips */
}

.chat-container {
    
    z-index: 1; /* Plus bas que les tooltips */
}

/* Cas spécifique pour les éléments qui pourraient bloquer */
.advanced-panel,
.modal,
.modal-content {
    z-index: 10000; /* Les modales restent au-dessus mais les tooltips sont à 99999 */
}

/* Animation d'entrée */
@keyframes tooltipSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-50%) translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) translateX(5px);
    }
}

.menu-item:hover .menu-tooltip {
    animation: tooltipSlideIn 0.3s ease-out forwards;
}

/* Pour les écrans plus petits - tooltip en position fixe */
@media (max-width: 1024px) {
    .menu-tooltip {
        position: fixed; /* Position fixe pour éviter les problèmes de z-index */
        left: auto;
        right: 10px;
        top: auto;
        bottom: 20px;
        transform: none;
        margin: 0;
        text-align: center;
        z-index: 999999 !important;
    }
    
    .menu-item:hover .menu-tooltip {
        transform: none;
        animation: tooltipFadeIn 0.3s ease-out forwards;
    }
    
    @keyframes tooltipFadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    /* Pas de flèche sur mobile */
    .menu-tooltip::before {
        display: none;
    }
}