/* File Attachment Styles */
.file-attachment {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    background: #f8f9fa;
}

.file-info {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.file-icon {
    margin-right: 12px;
    font-size: 24px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-size {
    font-size: 12px;
    color: #666;
}

.file-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.file-download-btn, .file-view-btn {
    padding: 6px 12px;
    border: 1px solid #007bff;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-download-btn:hover, .file-view-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
    color: white;
    text-decoration: none;
}

.file-thumbnail {
    text-align: center;
}

.file-thumbnail-image {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.file-thumbnail-image:hover {
    transform: scale(1.05);
}

/* Image Preview Modal Styles */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.image-preview-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.image-preview-modal .modal-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-preview-modal .modal-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
}

.image-preview-modal .close-modal {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.image-preview-modal .close-modal:hover {
    background: #e9ecef;
    color: #333;
}

.image-preview-modal .modal-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 70vh;
    overflow: hidden;
}

.image-preview-modal .preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-preview-modal .modal-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .file-attachment {
        padding: 8px;
    }
    
    .file-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .file-thumbnail-image {
        max-width: 150px;
        max-height: 100px;
    }
    
    .image-preview-modal .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .image-preview-modal .modal-header h4 {
        max-width: 250px;
        font-size: 14px;
    }
}