/* CSS Variables */ :root { --primary-color: #2563eb; --secondary-color: #64748b; --accent-color: #16a34a; --success-color: #059669; --error-color: #dc2626; --warning-color: #d97706; --bg-color: #f8fafc; --card-bg: #ffffff; --text-primary: #1e293b; --text-secondary: #64748b; --border-color: #e2e8f0; --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1); --radius: 8px; --font-family: 'Kanit', sans-serif; } /* Reset and Base Styles */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: var(--font-family); background-color: var(--bg-color); color: var(--text-primary); line-height: 1.6; font-size: 16px; } .container { max-width: 800px; margin: 0 auto; padding: 20px; min-height: 100vh; } /* Header */ .header { text-align: center; margin-bottom: 2rem; padding: 2rem 0; } .header h1 { font-size: 2rem; font-weight: 600; color: var(--primary-color); margin-bottom: 0.5rem; } .header h1 i { margin-right: 0.5rem; } .header p { color: var(--text-secondary); font-size: 1.1rem; } #header-description { transition: opacity 0.3s ease-in-out; } /* Main Content */ .main-content { display: flex; flex-direction: column; gap: 2rem; } /* Upload Section */ .upload-area { padding: 3rem 2rem; text-align: center; border: 2px dashed var(--border-color); border-radius: var(--radius); margin: 1rem; transition: all 0.3s ease; cursor: pointer; } .upload-area:hover { border-color: var(--primary-color); background-color: #f1f5f9; } .upload-area.drag-over { border-color: var(--primary-color); background-color: #dbeafe; transform: scale(1.02); } .upload-icon { font-size: 4rem; color: var(--primary-color); margin-bottom: 1rem; } .upload-area h3 { margin-bottom: 0.5rem; color: var(--text-primary); } .upload-area p { color: var(--text-secondary); margin-bottom: 2rem; } .upload-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; } .upload-info { color: var(--text-secondary); font-size: 0.9rem; } /* Buttons */ .btn { padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius); font-family: var(--font-family); font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.3s ease; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; text-decoration: none; } .btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); } .btn-primary { background: var(--primary-color); color: white; } .btn-primary:hover { background: #1d4ed8; } .btn-secondary { background: var(--secondary-color); color: white; } .btn-secondary:hover { background: #475569; } .btn-accent { background: var(--accent-color); color: white; } .btn-accent:hover { background: #15803d; } .btn-info { background: var(--warning-color); color: white; } .btn-info:hover { background: #c2720c; transform: translateY(-2px); } /* Camera Section */ .camera-section { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; } .camera-container { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; } #camera-video { width: 100%; height: auto; display: block; } .camera-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; } .camera-frame { width: 80%; height: 60%; border: 3px solid white; border-radius: var(--radius); box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); } .camera-controls { display: flex; gap: 1rem; justify-content: center; } /* QR Section */ .qr-section { padding: 2rem; background: white; border-radius: 16px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1); margin-bottom: 2rem; } .qr-scanner-container { max-width: 600px; margin: 0 auto; text-align: center; } .qr-scanner-container h3 { color: var(--primary-color); margin-bottom: 2rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 0.5rem; } .qr-camera-container { position: relative; margin-bottom: 2rem; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); background: var(--card-bg); } #qr-video { width: 100%; height: auto; max-height: 400px; object-fit: cover; display: block; } .qr-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; pointer-events: none; } .qr-frame { width: 200px; height: 200px; border: 3px solid var(--primary-color); border-radius: 16px; position: relative; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); } .qr-frame::before, .qr-frame::after { content: ''; position: absolute; width: 20px; height: 20px; border: 3px solid var(--primary-color); } .qr-frame::before { top: -3px; left: -3px; border-right: none; border-bottom: none; } .qr-frame::after { bottom: -3px; right: -3px; border-left: none; border-top: none; } .qr-instruction { margin-top: 1rem; color: white; background: rgba(0, 0, 0, 0.7); padding: 0.5rem 1rem; border-radius: 20px; font-weight: 500; } .qr-results { background: var(--bg-color); padding: 1.5rem; border-radius: 12px; margin-bottom: 2rem; border: 1px solid var(--border-color); text-align: left; } .qr-results h4 { color: var(--success-color); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; } .qr-data-display { margin-bottom: 1.5rem; } .qr-raw-section, .qr-parsed-section { margin-bottom: 1rem; } .qr-raw-section label, .qr-parsed-section label { display: block; font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; } #qr-raw-display { width: 100%; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 6px; background: white; font-family: 'Courier New', monospace; font-size: 0.875rem; resize: vertical; } .parsed-data { background: white; padding: 1rem; border-radius: 8px; border: 1px solid var(--border-color); } .parsed-data .data-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9; } .parsed-data .data-item:last-child { border-bottom: none; } .parsed-data .label { font-weight: 500; color: var(--text-secondary); min-width: 120px; } .parsed-data .value { font-weight: 600; color: var(--text-primary); text-align: right; word-break: break-all; } .qr-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; } .qr-controls { display: flex; justify-content: center; margin-top: 1rem; } /* Processing Section */ .processing-section { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; } .processing-container { text-align: center; } .processing-preview { margin-bottom: 2rem; } #processing-image { max-width: 100%; max-height: 300px; border-radius: var(--radius); box-shadow: var(--shadow); } .processing-status { margin-bottom: 1rem; } .progress-bar { width: 100%; height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; margin-bottom: 1rem; } .progress-fill { height: 100%; background: var(--primary-color); width: 0%; transition: width 0.3s ease; } #processing-text { color: var(--text-secondary); font-weight: 500; } /* Results Section */ .results-section { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; } .results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; } .results-header h2 { color: var(--success-color); font-weight: 600; display: flex; align-items: center; gap: 0.5rem; } .slip-data { margin-bottom: 2rem; } .data-row { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--border-color); } .data-row:last-child { border-bottom: none; } .label { font-weight: 500; color: var(--text-secondary); } .value { font-weight: 600; color: var(--text-primary); text-align: right; } .value.amount { font-size: 1.25rem; color: var(--success-color); } /* Enhanced Results Section */ .verification-status { padding: 1rem; border-radius: var(--radius); font-weight: 500; border: 2px solid transparent; } .verification-status.verified { background-color: #d1fae5; color: #065f46; border-color: #10b981; } .verification-status.warning { background-color: #fef3c7; color: #92400e; border-color: #f59e0b; } .verification-status.error { background-color: #fee2e2; color: #991b1b; border-color: #ef4444; } .status-main { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; } .status-details { font-size: 0.9rem; opacity: 0.8; margin-bottom: 0.5rem; } .confidence-score { font-size: 0.85rem; font-weight: 400; opacity: 0.7; } /* Image Preview Section */ .upload-section, .image-preview-section { padding: 2rem; background: white; border-radius: 16px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1); margin-bottom: 2rem; } .image-preview-container { max-width: 800px; margin: 0 auto; } .image-preview-container h3 { color: var(--primary-color); margin-bottom: 1.5rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; } .preview-image-wrapper { position: relative; margin: 0 auto 2rem; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); background: var(--card-bg); width: max-content; } .preview-image { width: 100%; height: auto; max-height: 500px; object-fit: contain; display: block; user-select: none; -webkit-user-select: none; -moz-user-select: none; } .qr-crop-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; } .crop-selection { position: absolute; border: 2px solid var(--primary-color); background: rgba(37, 99, 235, 0.1); pointer-events: all; cursor: move; min-width: 30px; min-height: 30px; transition: opacity 0.2s ease; } .crop-selection:hover { background: rgba(37, 99, 235, 0.15); } .crop-selection::before { content: 'QR Area'; position: absolute; top: -26px; left: 0; background: var(--primary-color); color: white; padding: 2px 6px; border-radius: 3px; font-size: 11px; font-weight: 500; white-space: nowrap; z-index: 10; } .crop-handle { position: absolute; width: 10px; height: 10px; background: var(--primary-color); border: 2px solid white; border-radius: 50%; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transition: all 0.2s ease; z-index: 10; } .crop-handle:hover { background: #1d4ed8; transform: scale(1.2); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); } .crop-handle.top-left { top: -5px; left: -5px; cursor: nw-resize; } .crop-handle.top-right { top: -5px; right: -5px; cursor: ne-resize; } .crop-handle.bottom-left { bottom: -5px; left: -5px; cursor: sw-resize; } .crop-handle.bottom-right { bottom: -5px; right: -5px; cursor: se-resize; } .crop-handle.top-center { top: -5px; left: 50%; transform: translateX(-50%); cursor: n-resize; } .crop-handle.bottom-center { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: s-resize; } .crop-handle.left-center { left: -5px; top: 50%; transform: translateY(-50%); cursor: w-resize; } .crop-handle.right-center { right: -5px; top: 50%; transform: translateY(-50%); cursor: e-resize; } .bank-selection { margin-bottom: 1.5rem; } .bank-selection h4 { color: var(--text-primary); margin-bottom: 0.5rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; } .bank-description { color: var(--text-secondary); font-size: 14px; margin-bottom: 1rem; padding: 8px 12px; background: rgba(37, 99, 235, 0.05); border-left: 3px solid var(--primary-color); border-radius: 4px; } /* Debug Info Styles */ .raw-data-content { padding: 1rem; background: #f8fafc; border: 1px solid var(--border-color); border-radius: var(--radius); margin-top: 1rem; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden; opacity: 1; } .raw-data-section { margin-bottom: 1.5rem; } .raw-data-section:last-child { margin-bottom: 0; } .raw-data-section h4 { font-size: 1rem; font-weight: 500; color: var(--text-primary); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; } .raw-data-section h5 { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); margin-bottom: 0.5rem; } .raw-data-section textarea { width: 100%; border: 1px solid var(--border-color); border-radius: 4px; padding: 0.75rem; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; font-size: 0.85rem; background: white; color: var(--text-primary); resize: vertical; line-height: 1.4; } .raw-data-section textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); } /* OCR Stats */ .ocr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; padding: 1rem; background: white; border: 1px solid var(--border-color); border-radius: var(--radius); } .stat-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem; background: #f8fafc; border-radius: 4px; } /* Results Actions */ .results-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; } .results-actions .btn { flex: 1; min-width: 150px; max-width: 200px; text-align: center; } /* Bank Selection */ .bank-selection { margin-bottom: 2rem; padding: 1.5rem; background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border-color); } .bank-selection h3 { margin-bottom: 1rem; color: var(--text-primary); font-size: 1.1rem; } .bank-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; } .bank-option { display: flex; align-items: center; padding: 0.75rem; background: #f8fafc; border: 2px solid var(--border-color); border-radius: var(--radius); cursor: pointer; transition: all 0.2s ease; } .bank-option:hover { border-color: var(--primary-color); background: #e0f2fe; } .bank-option input[type="radio"] { margin-right: 0.5rem; accent-color: var(--primary-color); } .bank-option input[type="radio"]:checked + .bank-label { color: var(--primary-color); font-weight: 500; } .bank-option:has(input:checked) { border-color: var(--primary-color); background: #dbeafe; } /* QR Mode Selection */ .qr-mode-selection { margin-bottom: 2rem; padding: 1.5rem; background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border-color); } .qr-mode-selection h3 { margin-bottom: 1rem; color: var(--text-primary); font-size: 1.1rem; } .qr-mode-buttons { display: flex; gap: 1rem; justify-content: center; } .qr-mode-buttons .btn { flex: 1; max-width: 200px; } /* QR Image Upload */ .qr-image-upload { margin-bottom: 1.5rem; } .qr-upload-area { padding: 2rem; border: 2px dashed var(--border-color); border-radius: var(--radius); text-align: center; cursor: pointer; transition: all 0.3s ease; background: #f8fafc; } .qr-upload-area:hover { border-color: var(--primary-color); background: #f1f5f9; } .qr-upload-area.drag-over { border-color: var(--primary-color); background: #dbeafe; transform: scale(1.02); } .qr-upload-area i { font-size: 3rem; color: var(--primary-color); margin-bottom: 1rem; display: block; } /* QR Preview Container */ .qr-preview-container { margin-top: 2rem; padding: 1.5rem; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius); } .qr-preview-container h4 { margin-bottom: 1rem; color: var(--text-primary); font-size: 1.1rem; } .qr-preview-wrapper { display: flex; flex-direction: column; gap: 1rem; } .qr-preview-area { position: relative; max-width: 100%; margin: 0 auto; border: 1px solid var(--border-color); border-radius: var(--radius); overflow: hidden; } #qr-preview-image { width: 100%; height: auto; display: block; max-height: 500px; object-fit: contain; } /* QR Selection Box */ .qr-selection-box { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; } .qr-selection-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); pointer-events: none; } .qr-selection-crop { position: absolute; top: 20%; left: 20%; width: 60%; height: 60%; border: 2px solid var(--primary-color); background: transparent; pointer-events: all; cursor: move; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); } .crop-handle { position: absolute; width: 12px; height: 12px; background: var(--primary-color); border: 2px solid white; border-radius: 50%; cursor: grab; } .crop-handle:active { cursor: grabbing; } .crop-handle.top-left { top: -6px; left: -6px; cursor: nw-resize; } .crop-handle.top-right { top: -6px; right: -6px; cursor: ne-resize; } .crop-handle.bottom-left { bottom: -6px; left: -6px; cursor: sw-resize; } .crop-handle.bottom-right { bottom: -6px; right: -6px; cursor: se-resize; } /* Crop Selection Animation Effects */ .crop-selection.selection-created { animation: crop-created 0.3s ease-out; } .crop-selection.click-created { animation: crop-click 0.3s ease-out; } @keyframes crop-created { 0% { transform: scale(0.8); opacity: 0.7; } 50% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } } @keyframes crop-click { 0% { transform: scale(0.5); opacity: 0.5; } 100% { transform: scale(1); opacity: 1; } } /* Click-and-drag cursor styles */ .preview-image-wrapper.click-mode { cursor: crosshair; } .preview-image-wrapper.click-mode .preview-image { cursor: crosshair; } /* Mobile touch improvements */ @media (max-width: 768px) { .crop-handle { width: 14px; height: 14px; } .crop-handle.top-left, .crop-handle.top-right, .crop-handle.bottom-left, .crop-handle.bottom-right { top: -7px; left: -7px; } .crop-handle.top-right { top: -7px; right: -7px; } .crop-handle.bottom-left { bottom: -7px; left: -7px; } .crop-handle.bottom-right { bottom: -7px; right: -7px; } .crop-handle.top-center { top: -7px; left: 50%; transform: translateX(-50%); cursor: n-resize; } .crop-handle.bottom-center { bottom: -7px; left: 50%; transform: translateX(-50%); cursor: s-resize; } .crop-handle.left-center { left: -7px; top: 50%; transform: translateY(-50%); cursor: w-resize; } .crop-handle.right-center { right: -7px; top: 50%; transform: translateY(-50%); cursor: e-resize; } /* Improve touch targets */ .crop-selection { min-width: 40px; min-height: 40px; } } /* Animation for creating selection */ .crop-selection.creating { animation: pulse 1s infinite; } @keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; } } /* Section Transitions */ .main-content > section { opacity: 0; transform: translateY(20px); transition: all 0.4s ease-in-out; pointer-events: none; } .main-content > section[style*="block"] { opacity: 1; transform: translateY(0); pointer-events: auto; } /* Section Animation Classes */ .section-enter { animation: sectionEnter 0.4s ease-out forwards; } .section-exit { animation: sectionExit 0.3s ease-in forwards; } @keyframes sectionEnter { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } @keyframes sectionExit { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-10px); } } /* Progress Steps */ .progress-steps { display: flex; align-items: center; justify-content: center; margin-top: 2rem; padding: 1rem 0; gap: 1rem; } .step { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; transition: all 0.3s ease; opacity: 0.5; } .step.active { opacity: 1; } .step.completed { opacity: 0.8; } .step-icon { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--border-color); color: var(--text-secondary); font-size: 1.2rem; transition: all 0.3s ease; } .step.active .step-icon { background: var(--primary-color); color: white; transform: scale(1.1); } .step.completed .step-icon { background: var(--success-color); color: white; } .step-label { font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; text-align: center; } .step.active .step-label { color: var(--primary-color); font-weight: 600; } .step.completed .step-label { color: var(--success-color); } .step-connector { width: 40px; height: 2px; background: var(--border-color); transition: all 0.3s ease; transform: translateY(-15px); } .step-connector.completed { background: var(--success-color); } /* Responsive Progress Steps */ @media (max-width: 768px) { .progress-steps { gap: 0.5rem; } .step-icon { width: 40px; height: 40px; font-size: 1rem; } .step-label { font-size: 0.8rem; } .step-connector { width: 20px; } } /* Section Headers */ .section-header { text-align: center; margin-bottom: 2rem; padding: 1rem 0; border-bottom: 2px solid var(--border-color); } .section-header h2 { font-size: 1.5rem; color: var(--primary-color); margin-bottom: 0.5rem; font-weight: 600; } .section-header h2 i { margin-right: 0.5rem; color: var(--primary-color); } .section-header p { color: var(--text-secondary); font-size: 1rem; margin: 0; line-height: 1.5; } /* Next Step Info */ .next-step-info { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; padding: 1rem; background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%); border-radius: var(--radius); border-left: 4px solid var(--primary-color); color: var(--text-secondary); font-size: 0.95rem; } .next-step-info i { color: var(--primary-color); font-size: 1.1rem; } /* Toggle Button for Raw Data */ .ocr-raw-data h3 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; cursor: pointer; user-select: none; } .btn-toggle { background: var(--primary-color); color: white; border: none; padding: 0.5rem 1rem; border-radius: var(--radius); font-size: 0.85rem; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; transition: all 0.3s ease; outline: none; } .btn-toggle:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3); } .btn-toggle:active { transform: translateY(0); } .btn-toggle i { transition: transform 0.3s ease; } .btn-toggle[data-expanded="true"] i { transform: rotate(180deg); } .toggle-text { font-family: var(--font-family); } /* OCR Raw Data Section */ .ocr-raw-data { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius); margin-top: 1rem; overflow: hidden; } .ocr-raw-data h3 { background: linear-gradient(135deg, var(--primary-color), #1d4ed8); color: white; padding: 1rem; margin: 0; font-size: 1.1rem; font-weight: 500; } .ocr-raw-data h3 i { margin-right: 0.5rem; } .raw-data-description { padding: 0.75rem 1rem; background: rgba(37, 99, 235, 0.05); border-bottom: 1px solid var(--border-color); font-size: 0.9rem; color: var(--text-secondary); } .raw-data-description p { margin: 0; display: flex; align-items: center; gap: 0.5rem; } .raw-data-description i { color: var(--primary-color); }