﻿/* Styles pour les boutons d'action des messages */
.message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.message-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

.message-actions .btn-edit {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.message-actions .btn-delete {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.message-actions .btn-edit:hover {
    background-color: #ffca2c;
    border-color: #ffc720;
}

.message-actions .btn-delete:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
}

/* Styles pour les messages */
.message {
    max-width: 70%;
    padding: 0.75rem;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-sent {
    background-color: #007bff;
    color: white;
    margin-left: auto;
}

.message-received {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.message-author {
    font-weight: 600;
}

.message-time {
    font-size: 0.75rem;
    white-space: nowrap;
}

.message-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    word-break: break-word;
}

/* Styles pour les pièces jointes */
.message-attachment {
    margin-top: 0.5rem;
}

.attachment-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.attachment-link:hover {
    text-decoration: none;
    color: inherit;
}

.file-attachment {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.file-attachment:hover {
    background-color: #e9ecef !important;
}

.message-sent .file-attachment {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    color: #333;
}

.message-sent .file-attachment:hover {
    background-color: rgba(255, 255, 255, 1) !important;
    color: #333;
}

.message-sent .file-attachment i {
    color: #333;
}

.message-sent .file-attachment span {
    color: #333;
}
/* Responsive */
@media (max-width: 768px) {
    .message {
        max-width: 85%;
        padding: 0.625rem;
        border-radius: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    .message-header {
        font-size: 0.8125rem;
        margin-bottom: 0.375rem;
    }
    
    .message-author {
        font-size: 0.8125rem;
    }
    
    .message-time {
        font-size: 0.6875rem;
    }
    
    .message-content {
        font-size: 0.9375rem;
        line-height: 1.5;
    }
}

@media (max-width: 576px) {
    .message {
        max-width: 90%;
        padding: 0.5rem;
        border-radius: 0.75rem;
        margin-bottom: 0.625rem;
    }
    
    .message-header {
        font-size: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.125rem;
    }
    
    .message-author {
        font-size: 0.75rem;
    }
    
    .message-time {
        font-size: 0.625rem;
    }
    
    .message-content {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    .message-sent {
        margin-left: auto;
        margin-right: 0;
    }
    
    .message-received {
        margin-right: auto;
        margin-left: 0;
    }
}

@media (max-width: 400px) {
    .message {
        max-width: 95%;
        padding: 0.5rem;
    }
    
    .message-header {
        font-size: 0.6875rem;
    }
    
    .message-content {
        font-size: 0.8125rem;
    }
}

/* Modal d'édition de message */
.edit-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.edit-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    position: relative;
    z-index: 10000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.edit-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.edit-modal-close:hover {
    color: #000;
}

.edit-modal textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

.edit-modal-buttons {
    margin-top: 15px;
    text-align: right;
}

.edit-modal-buttons button {
    margin-left: 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.edit-modal-buttons .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.edit-modal-buttons .btn-primary {
    background-color: #007bff;
    color: white;
}

.edit-modal-buttons button:hover {
    opacity: 0.9;
}

/* S'assurer que le footer n'interfère pas avec les modals */
footer {
    z-index: 1;
}

/* S'assurer que les autres éléments n'interfèrent pas */
.navbar, .sidebar, .main-content {
    z-index: auto;
}
