/* Fix hauteur conversations mobile - VERSION SAFE */

@media (max-width: 768px) {
    /* PAS de position fixed - juste améliorer la hauteur */
    
    /* Container principal */
    #mes-conversations .conversations-list {
        min-height: 70vh; /* Hauteur minimale */
        display: flex;
        flex-direction: column;
    }
    
    /* Sidebar qui contient la liste */
    #mes-conversations .conversations-sidebar {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 500px; /* Hauteur minimale */
    }
    
    /* Header avec titre et bouton */
    #mes-conversations .conversations-header {
        flex-shrink: 0;
        padding: 15px;
        background: #2c5530;
        color: white;
    }
    
    #mes-conversations .conversations-header h3 {
        color: white;
        margin: 0;
    }
    
    /* Liste des conversations scrollable */
    #mes-conversations .conversations-items,
    #conversations-items {
        flex: 1;
        overflow-y: auto;
        max-height: 60vh; /* Limite la hauteur pour permettre le scroll */
        min-height: 400px;
        -webkit-overflow-scrolling: touch; /* Scroll fluide iOS */
    }
    
    /* Items individuels */
    .conversation-item {
        padding: 15px;
        border-bottom: 1px solid #e0e0e0;
        background: white;
        cursor: pointer;
    }
    
    .conversation-item:active {
        background: #f5f5f5;
    }
    
    /* Detail conversation - NE PAS utiliser fixed */
    #mes-conversations .conversation-detail {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        background: white;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 10;
    }
    
    /* Ouverture du chat */
    .conversations-list.chat-open .conversation-detail {
        transform: translateX(0);
    }
    
    .conversations-list.chat-open .conversations-sidebar {
        transform: translateX(-100%);
    }
}

/* Desktop - comportement normal */
@media (min-width: 769px) {
    #mes-conversations .conversations-items {
        max-height: 500px;
        overflow-y: auto;
    }
}
