/**
 * Professional File Upload Styles
 *
 * Enhanced styling for the file upload drawer, file cards, and drag & drop functionality
 * to provide a ChatGPT-level user experience.
 */

/* Attachment Button Disabled State */
button[data-disabled="true"] {
    opacity: 0.3 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

button[data-disabled="true"]:hover {
    color: inherit !important;
    background-color: inherit !important;
    transform: none !important;
}

/* Upload Drawer Animations */
#uploadDrawer {
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

#uploadDrawer:not(.hidden) {
    transform: translateX(0);
}

#uploadBackdrop {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#uploadBackdrop:not(.hidden) {
    opacity: 1;
}

/* Professional File Cards */
.file-card {
    transition: all 0.2s ease-in-out;
    border: 1px solid rgb(229 231 235);
}

.dark .file-card {
    border-color: rgb(55 65 81);
}

.file-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .file-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* File Icon Styling */
.file-icon {
    background: linear-gradient(135deg, rgb(249 250 251) 0%, rgb(243 244 246) 100%);
}

.dark .file-icon {
    background: linear-gradient(135deg, rgb(55 65 81) 0%, rgb(75 85 99) 100%);
}

/* Enhanced Dropzone */
#dropZone {
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

#dropZone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease-in-out;
}

#dropZone.animate-pulse::before {
    left: 100%;
}

/* File Badge Enhancement */
#fileBadge {
    animation: badge-pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
}

@keyframes badge-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Progress Bar Animations */
.file-progress {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    background-size: 200% 100%;
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Upload Status Indicators */
.status-uploading {
    animation: status-pulse 1.5s infinite;
}

@keyframes status-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-uploaded {
    animation: status-success 0.5s ease-out;
}

@keyframes status-success {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Enhanced Button Styles */
.remove-file-btn, .download-file-btn {
    transition: all 0.2s ease-in-out;
}

.remove-file-btn:hover {
    transform: scale(1.1);
}

.download-file-btn:hover {
    transform: scale(1.1);
}

/* Drag and Drop Visual Enhancements */
.dropzone-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 197, 253, 0.1) 100%);
    border-color: rgb(59 130 246);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.dark .dropzone-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 197, 253, 0.1) 100%);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* File Type Icons Color Enhancement */
.file-card .fa-file-pdf { color: #dc2626; }
.file-card .fa-file-word { color: #2563eb; }
.file-card .fa-file-excel { color: #16a34a; }
.file-card .fa-file-powerpoint { color: #ea580c; }
.file-card .fa-file-lines { color: #6b7280; }
.file-card .fa-file-image { color: #9333ea; }
.file-card .fa-file-code { color: #eab308; }
.file-card .fa-file-zipper { color: #ea580c; }

/* Responsive Enhancements */
@media (max-width: 640px) {
    #uploadDrawer {
        width: 100%;
        max-width: none;
    }
    
    .file-card {
        padding: 0.75rem;
    }
    
    .file-icon {
        width: 2rem;
        height: 2rem;
    }
    
    .file-icon i {
        font-size: 1rem;
    }
}

/* Loading States */
.file-loading {
    position: relative;
    overflow: hidden;
}

.file-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading-shimmer 1.5s infinite;
}

.dark .file-loading::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

@keyframes loading-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Toast Notification Enhancements */
.swal2-toast {
    backdrop-filter: blur(10px);
}

/* Accessibility Enhancements */
.file-card:focus-within {
    outline: 2px solid rgb(59 130 246);
    outline-offset: 2px;
}

.remove-file-btn:focus,
.download-file-btn:focus {
    outline: 2px solid rgb(59 130 246);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .file-card {
        border-width: 2px;
    }
    
    .file-icon {
        border: 1px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    #uploadDrawer,
    #uploadBackdrop,
    .file-card,
    .remove-file-btn,
    .download-file-btn {
        transition: none;
    }
    
    #fileBadge {
        animation: none;
    }
    
    .file-progress {
        animation: none;
    }
}
