/**
 * File Uploader Styles
 * Clean, modern design with minimal styling for easy integration
 */

/* ============================================================================
   FILE UPLOAD CONTAINER
   ============================================================================ */

.file-upload-container {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    margin-bottom: 1rem;
}

/* ============================================================================
   DROPZONE STYLES
   ============================================================================ */

.file-dropzone {
    color: var(--color-input);
    position: relative;
    border: 1px dashed var(--color-input-border);
    border-radius: var(--border-radius);
    background: var(--color-input-background);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
}

.file-dropzone:hover {
    border-color: #9ca3af;
    background-color: #f3f4f6;
}

.file-dropzone.drag-over {
    border-color: #3b82f6;
    background-color: #eff6ff;
    transform: scale(1.02);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.dropzone-icon {
    font-size: 2rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.dropzone-text {
    //color: #6b7280;
    font-size: 0.875rem;
}

.dropzone-text p {
    margin: 0;
    line-height: 1.4;
}

.file-select-btn {
    background: none;
    border: none;
    color: #0b60ea;
	text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
    margin: 0;
    transition: color 0.2s ease;
}

.file-select-btn:hover {
    color: #2563eb;
	text-decoration: none;
}

.file-select-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================================================
   ERROR STYLES
   ============================================================================ */

.file-upload-container.has-error .file-dropzone {
    border-color: #dc2626;
    background-color: #fef2f2;
}

/* ============================================================================
   FILE LIST STYLES
   ============================================================================ */

.file-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.file-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.file-item.uploading {
    border-left: 3px solid #3b82f6;
}

.file-item.success {
    border-left: 3px solid #10b981;
}

.file-item.error {
    border-left: 3px solid #ef4444;
}

/* File Info Section */
.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.file-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.file-details {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.file-name {
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.file-size,
.file-type {
    white-space: nowrap;
}

/* File Status Section */
.file-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.status-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    transition: color 0.2s ease;
}

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    min-width: 80px;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.2s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    min-width: 35px;
    text-align: right;
}

/* Remove Button */
.file-remove-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-remove-btn:hover {
    background-color: #f3f4f6;
    color: #ef4444;
}

.file-remove-btn:focus {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

/* Error Message */
.file-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
}

/* ============================================================================
   STATUS-SPECIFIC STYLES
   ============================================================================ */

/* Pending Status */
.file-item .status-icon[data-status="pending"] {
    color: #6b7280;
}

/* Uploading Status */
.file-item.uploading .progress-fill {
    background-color: #3b82f6;
}

.file-item.uploading .status-icon {
    color: #3b82f6;
}

/* Success Status */
.file-item.success .progress-fill {
    background-color: #10b981;
}

.file-item.success .status-icon {
    color: #10b981;
}

/* Error Status */
.file-item.error .progress-fill {
    background-color: #ef4444;
}

.file-item.error .status-icon {
    color: #ef4444;
}

/* ============================================================================
   ERROR NOTIFICATION
   ============================================================================ */

.file-upload-error {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ef4444;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    max-width: 300px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 640px) {
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .file-status {
        width: 100%;
        justify-content: space-between;
    }
    
    .progress-container {
        flex: 1;
    }
    
    .file-remove-btn {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .file-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Focus styles for keyboard navigation */
.file-dropzone:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

/* File item entrance animation */
.file-item {
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress bar animation */
.progress-fill {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   THEME INTEGRATION
   ============================================================================ */

/* CSS Variables for easy theming */
:root {
    --file-upload-border-color: #d1d5db;
    --file-upload-border-hover: #9ca3af;
    --file-upload-border-drag: #3b82f6;
    --file-upload-bg: #f9fafb;
    --file-upload-bg-hover: #f3f4f6;
    --file-upload-bg-drag: #eff6ff;
    --file-upload-text: #6b7280;
    --file-upload-text-primary: #111827;
    --file-upload-primary: #3b82f6;
    --file-upload-success: #10b981;
    --file-upload-error: #ef4444;
    --file-upload-warning: #f59e0b;
}
