/* Styles pour la gestion des fichiers attachés */

/* Prévisualisation du fichier */
.file-preview {
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    animation: slideDown 0.3s ease;
    max-height: 300px;
    overflow-y: auto;
}

.file-preview-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.file-preview-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.file-preview-item>i {
    font-size: 20px;
    color: #667eea;
    flex-shrink: 0;
}

.file-preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-preview-item .file-preview-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-size {
    font-size: 12px;
    color: #6c757d;
}

.file-preview-item .btn-icon {
    background: #fff3f3;
    color: #dc3545;
    border: 1px solid #dc3545;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.file-preview-item .btn-icon:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-preview-content {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.file-preview-content i.fa-file {
    font-size: 20px;
    color: #667eea;
}

.file-preview-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-content .btn-icon {
    background: #fff3f3;
    color: #dc3545;
    border: 1px solid #dc3545;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.file-preview-content .btn-icon:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

/* Bouton d'attachement */
#attachFileBtn {
    background: white;
    color: #667eea;
    border: 1px solid #e9ecef;
    margin-right: 8px;
    transition: all 0.2s ease;
}

#attachFileBtn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateY(-2px);
}

#attachFileBtn i {
    font-size: 16px;
}

/* Messages avec fichiers attachés */
.message-attachment {
    margin-top: 8px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.message-attachment:hover {
    background-color: #e9f5ff;
    border-color: #667eea;
    transform: translateX(2px);
}

.message-attachment-icon {
    font-size: 24px;
    color: #667eea;
    flex-shrink: 0;
}

.message-attachment-info {
    flex: 1;
    min-width: 0;
}

.message-attachment-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-attachment-size {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

.message-attachment-download {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
    flex-shrink: 0;
}

.message-attachment-download i {
    margin-left: 4px;
}

/* Messages utilisateur */
.chat-message.user .message-attachment {
    background-color: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
}

.chat-message.user .message-attachment:hover {
    background-color: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

/* Messages agent */
.chat-message.agent .message-attachment {
    background-color: rgba(108, 117, 125, 0.05);
}

.chat-message.agent .message-attachment:hover {
    background-color: rgba(108, 117, 125, 0.1);
}

/* Icônes selon le type de fichier */
.message-attachment-icon .fa-file-pdf {
    color: #dc3545;
}

.message-attachment-icon .fa-file-word {
    color: #007bff;
}

.message-attachment-icon .fa-file-excel {
    color: #28a745;
}

.message-attachment-icon .fa-file-image {
    color: #ffc107;
}

.message-attachment-icon .fa-file-archive {
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .file-preview-content {
        flex-wrap: wrap;
    }

    .message-attachment {
        padding: 10px;
        gap: 8px;
    }

    .message-attachment-name {
        font-size: 13px;
    }

    .message-attachment-size {
        font-size: 11px;
    }
}