/* File Upload Component Styles */
/* Task 4.3: File Upload UI Components */

.file-upload-container {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px;
    background-color: #f9fafb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.file-upload-container:hover {
    border-color: #6366f1;
    background-color: #f3f4f6;
}

.file-upload-container.drag-over {
    border-color: #4f46e5;
    background-color: #eef2ff;
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
}

.file-upload-container.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.file-drop-zone {
    text-align: center;
    padding: 40px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.file-drop-zone.drag-over {
    background-color: rgba(79, 70, 229, 0.1);
    border: 2px dashed #4f46e5;
}

.file-drop-zone.has-files {
    border: 2px solid #10b981;
    background-color: #f0fdf4;
}

.file-drop-zone.has-errors {
    border: 2px solid #ef4444;
    background-color: #fef2f2;
}

.file-drop-zone h6 {
    margin-bottom: 10px;
    color: #374151;
    font-weight: 600;
}

.file-drop-zone p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 15px;
}

.file-drop-zone.drag-over p {
    color: #4f46e5;
    font-weight: 500;
}

.file-upload-icon {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 15px;
    transition: color 0.2s ease;
}

.drag-over .file-upload-icon {
    color: #4f46e5;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.file-upload-input {
    display: none;
}

.file-upload-button {
    background-color: #4f46e5;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    margin-top: 10px;
}

.file-upload-button:hover {
    background-color: #4338ca;
}

.file-upload-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

/* File List Styles */
.file-list {
    margin-top: 20px;
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

.file-list h6 {
    margin-bottom: 15px;
    color: #374151;
    font-weight: 600;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 10px;
    background-color: white;
    transition: all 0.2s ease;
}

.file-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.file-item.uploading {
    background-color: #fef3c7;
    border-color: #f59e0b;
}

.file-item.success {
    background-color: #d1fae5;
    border-color: #10b981;
}

.file-item.error {
    background-color: #fee2e2;
    border-color: #ef4444;
}

.file-preview {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 12px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #6b7280;
}

.file-preview img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
}

.file-size {
    font-size: 12px;
    color: #6b7280;
}

.file-actions {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

.file-actions button {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-actions button:hover {
    background-color: #f3f4f6;
}

.file-actions .btn-danger {
    color: #dc2626;
    border-color: #dc2626;
}

.file-actions .btn-danger:hover {
    background-color: #dc2626;
    color: white;
}

/* Progress Bar Styles */
.file-progress {
    width: 100%;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.file-progress-bar {
    height: 100%;
    background-color: #4f46e5;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.file-progress-bar.success {
    background-color: #10b981;
}

.file-progress-bar.error {
    background-color: #ef4444;
}

/* Error Messages */
.file-upload-errors {
    margin-top: 15px;
    padding: 12px;
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
}

.file-upload-errors h6 {
    color: #dc2626;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.file-upload-errors ul {
    margin: 0;
    padding-left: 20px;
}

.file-upload-errors li {
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 4px;
}

/* Success Messages */
.file-upload-success {
    margin-top: 15px;
    padding: 12px;
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    color: #065f46;
}

/* Loading Spinner */
.file-upload-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .file-upload-container {
        padding: 15px;
    }
    
    .file-drop-zone {
        padding: 30px 15px;
        min-height: 150px;
    }
    
    .file-upload-icon {
        font-size: 36px;
    }
    
    .file-item {
        padding: 10px;
    }
    
    .file-preview {
        width: 32px;
        height: 32px;
    }
    
    .file-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Animation for file removal */
.file-item.removing {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* File type icons */
.file-type-icon {
    font-size: 20px;
    color: #6b7280;
}

.file-type-icon.image {
    color: #10b981;
}

.file-type-icon.pdf {
    color: #dc2626;
}

.file-type-icon.document {
    color: #2563eb;
}

.file-type-icon.archive {
    color: #7c3aed;
}

.file-type-icon.video {
    color: #f59e0b;
}

.file-type-icon.audio {
    color: #ec4899;
}

/* Drag overlay */
.file-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(79, 70, 229, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #4f46e5;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.file-upload-container.drag-over .file-upload-overlay {
    opacity: 1;
}

/* Accessibility improvements */
.file-upload-container:focus-within {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
} 