/* Styles pour la messagerie */
.messagerie-container {
    display: flex;
    height: calc(100vh - 100px); /* Ajuster selon la hauteur du header */
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.messagerie-sidebar {
    width: 300px;
    background-color: white;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.messagerie-sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.messagerie-sidebar-header h5 {
    margin: 0;
    font-weight: 600;
}

.messagerie-liste-conversations {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    padding: 15px;
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
    transition: background-color 0.2s;
}

.conversation-item:hover {
    background-color: #f8f9fa;
}

.conversation-item.active {
    background-color: #e7f1ff;
    border-left: 4px solid #0d6efd;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.conversation-nom {
    font-weight: 600;
    color: #343a40;
}

.conversation-date {
    font-size: 0.8rem;
    color: #868e96;
}

.conversation-preview {
    font-size: 0.9rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messagerie-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
}

.messagerie-main-header {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    background-color: white;
}

.messagerie-main-header h5 {
    margin: 0;
}

.messagerie-messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.message-bulle {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 10px;
    position: relative;
    word-wrap: break-word;
}

.message-recu {
    align-self: flex-start;
    background-color: white;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 5px;
}

.message-envoye {
    align-self: flex-end;
    background-color: #0d6efd;
    color: white;
    border-bottom-right-radius: 5px;
}

.message-info {
    font-size: 0.75rem;
    margin-top: 5px;
    opacity: 0.7;
    text-align: right;
}

.messagerie-input-area {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    background-color: white;
    display: flex;
    gap: 10px;
}

.messagerie-input-area .d-flex.w-100 {
    gap: 10px;
}

.messagerie-input-area textarea {
    resize: none;
    height: 50px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #adb5bd;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .messagerie-container {
        height: calc(100vh - 140px);
        flex-direction: column;
    }

    .messagerie-sidebar {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

    .messagerie-main {
        height: 60%;
    }
}
