/* File Upload Component CSS */

/* File Upload Wrapper */
.file-upload-wrapper {
    position: relative;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Drag & Drop Zone Styles */
.file-drop-zone {
    background: #f8f9fa;
    transition: all 0.3s ease;
    user-select: none;
    cursor: pointer;
}

.file-drop-zone:hover {
    background: #e9ecef;
    border-color: #6c757d !important;
}

.file-drop-zone.dragover {
    background: #cff4fc !important;
    border-color: #0dcaf0 !important;
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(13, 202, 240, 0.25);
}

/* File List Styles */
.file-list {
    display: none;
}

.file-list.has-files {
    display: block;
}

.file-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.15s ease-in-out;
}

.file-item:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* File Preview Styles */
.file-preview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 1px solid #ddd;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview .file-icon {
    font-size: 1.5rem;
}

/* File Input Fields */
.file-display-name:focus,
.file-description:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* File Item Actions */
.file-actions {
    display: flex;
    gap: 0.25rem;
}

.file-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Existing Attachments Styles */
.existing-attachments {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
}

.existing-attachment {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.existing-attachment:last-child {
    margin-bottom: 0;
}

/* File Size and Info */
.file-info {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Upload Guidelines */
.upload-guidelines {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.4;
}

.upload-guidelines strong {
    color: #495057;
}

/* Responsive Design */
@media (max-width: 768px) {
    .file-item .row {
        --bs-gutter-x: 0.75rem;
    }
    
    .file-preview {
        width: 50px;
        height: 50px;
    }
    
    .file-preview .file-icon {
        font-size: 1.25rem;
    }
    
    .file-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .file-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Attachment Sorting Styles */
.existing-attachment {
    transition: all 0.2s ease;
    user-select: none;
}

.existing-attachment.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.existing-attachment:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.drag-handle {
    cursor: grab !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 100%;
    color: #6c757d;
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: #495057;
}

.drag-handle:active {
    cursor: grabbing !important;
}

.existing-attachments {
    position: relative;
}

/* Visual feedback during drag */
.existing-attachment.drag-over {
    border-top: 2px solid #007bff;
}

.existing-attachment.drag-over-bottom {
    border-bottom: 2px solid #007bff;
}