/* JPG to Word Converter Styles - Clean & Elegant UI/UX */

/* File Item Styling */
.file-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(228, 228, 231, 0.8);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.file-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 15px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    background: rgba(255, 255, 255, 0.95);
}

/* Drag and Drop Zone */
.drag-over {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-color: #3b82f6;
    border-width: 2px;
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    animation: gentle-pulse 2s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

.drag-over * {
    pointer-events: none;
}

/* Badge Styling */
.format-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.ocr-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.confidence-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.confidence-badge.high {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.confidence-badge.medium {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.2);
}

/* Loading Spinner */
.loading-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: smooth-spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes smooth-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* OCR Progress Spinner */
.ocr-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: ocr-spin 1.5s linear infinite;
}

@keyframes ocr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #f8fafc, #f1f5f9);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1, #8b5cf6);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 25%, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 50%, 
        transparent 75%, 
        rgba(255, 255, 255, 0.1) 75%);
    background-size: 20px 20px;
    animation: progress-stripe 1s linear infinite;
}

@keyframes progress-stripe {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

/* Message Styling */
.error-message {
    padding: 12px 16px;
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #dc2626;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.1);
    backdrop-filter: blur(8px);
}

.success-message {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f9ff, #bae6fd);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #0369a1;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(3, 105, 161, 0.1);
    backdrop-filter: blur(8px);
}

.warning-message {
    padding: 12px 16px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #d97706;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(217, 119, 6, 0.1);
    backdrop-filter: blur(8px);
}

/* Preset Button Styling */
.preset-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.preset-btn::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.6s ease;
}

.preset-btn:hover {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.preset-btn:hover::before {
    left: 100%;
}

.preset-btn.active {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    color: #1e293b;
    border: 2px solid #3b82f6;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15), 
                0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
    font-weight: 600;
    position: relative;
}

.preset-btn.active::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(99, 102, 241, 0.05));
    border-radius: 8px;
    z-index: -1;
}

.preset-btn.active::before {
    display: none;
}

/* Image Preview Styling */
.image-preview {
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.image-preview:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.image-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    items-center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview:hover .image-overlay {
    opacity: 1;
}

.extracted-text {
    max-height: 120px;
    overflow-y: auto;
    padding: 12px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    line-height: 1.4;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

.extracted-text::-webkit-scrollbar {
    width: 4px;
}

.extracted-text::-webkit-scrollbar-track {
    background: transparent;
}

.extracted-text::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(99, 102, 241, 0.3));
    border-radius: 2px;
}

/* Form Controls */
select, input[type="checkbox"] {
    transition: all 0.2s ease;
}

select:focus, input[type="checkbox"]:focus {
    outline: none;
    ring: 2px;
    ring-color: rgba(59, 130, 246, 0.5);
    border-color: #3b82f6;
}

input[type="checkbox"] {
    accent-color: #3b82f6;
}

input[type="checkbox"]:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* Additional Enhancements */
.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.shadow-elegant {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
}

.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus States for Accessibility */
button:focus,
input:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* OCR Status Indicators */
.ocr-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.ocr-status.processing {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.ocr-status.completed {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.ocr-status.error {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #dc2626;
}

/* Text Recognition Animation */
.text-recognition {
    position: relative;
    overflow: hidden;
}

.text-recognition::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    animation: scan-line 2s ease-in-out infinite;
}

@keyframes scan-line {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .file-item {
        border-radius: 12px;
    }
    
    .preset-btn {
        border-radius: 10px;
    }
    
    .image-preview {
        border-radius: 10px;
    }
    
    .image-preview img {
        height: 150px;
    }
    
    .extracted-text {
        font-size: 11px;
        max-height: 100px;
    }
}
