/* Enhanced File Upload Styles */

.enhanced-file-upload {
    margin: 15px 0;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.upload-area--dragover {
    border-color: #007bff;
    background: #e6f3ff;
    transform: scale(1.02);
}

.upload-area--success {
    border-color: #28a745;
    background: #f0fff4;
}

.upload-area--error {
    border-color: #dc3545;
    background: #fff5f5;
}

.upload-area__icon {
    font-size: 48px;
    color: #007bff;
    margin-bottom: 15px;
}

.upload-area--success .upload-area__icon {
    color: #28a745;
}

.upload-area--error .upload-area__icon {
    color: #dc3545;
}

.upload-area__title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.upload-area__subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.4;
}

.upload-area__button {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.upload-area__button:hover {
    background: #0056b3;
}

.upload-area--success .upload-area__button {
    background: #28a745;
}

.upload-area--success .upload-area__button:hover {
    background: #1e7e34;
}

/* File Preview Area */
.file-preview-area {
    margin-top: 20px;
}

.file-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.file-preview {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.file-preview__image img {
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.file-preview__icon {
    margin-bottom: 10px;
}

.file-preview__info {
    margin-top: 10px;
}

.file-preview__name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
    word-break: break-word;
}

.file-preview__size {
    color: #666;
    font-size: 12px;
    margin-bottom: 2px;
}

.file-preview__type {
    color: #007bff;
    font-size: 12px;
    font-weight: 500;
}

.file-preview__remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.file-preview__remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Validation Messages */
.validation-messages {
    margin-top: 15px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert strong {
    font-weight: 600;
}

.alert ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.alert li {
    margin-bottom: 4px;
}

/* Progress Bar (for future upload progress) */
.upload-progress {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.upload-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* File Type Icons Colors */
.file-preview__icon .fa-file-pdf {
    color: #ff4444;
}

.file-preview__icon .fa-file-word {
    color: #2b5ce6;
}

.file-preview__icon .fa-file-excel {
    color: #217346;
}

.file-preview__icon .fa-file-image {
    color: #f39c12;
}

.file-preview__icon .fa-file-csv {
    color: #217346;
}

.file-preview__icon .fa-file-alt {
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .file-previews {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-area__icon {
        font-size: 36px;
    }
    
    .upload-area__title {
        font-size: 16px;
    }
    
    .upload-area__subtitle {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .file-previews {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        padding: 20px 10px;
    }
}

/* Animation for file drop */
@keyframes dropAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.upload-area--dropping {
    animation: dropAnimation 0.3s ease-in-out;
}

/* Loading states */
.upload-area--loading {
    pointer-events: none;
    opacity: 0.7;
}

.upload-area--loading .upload-area__icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007bff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.upload-area:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.file-preview__remove:focus {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .upload-area {
        border-width: 3px;
    }
    
    .file-preview {
        border-width: 2px;
    }
    
    .alert {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .upload-area,
    .file-preview,
    .upload-area__button,
    .file-preview__remove {
        transition: none;
    }
    
    .upload-area--dragover {
        transform: none;
    }
    
    .file-preview:hover {
        transform: none;
    }
}