/* ======================
   DOCUMENT SCANNER STYLES
   ====================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Scanner Page Container */
.scanner-page {
    min-height: 100vh;
    padding: 2rem 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Notification Container */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    animation: slideIn 0.3s ease-out forwards;
}

.notification.success { background: linear-gradient(135deg, #10b981, #059669); }
.notification.error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.notification.info { background: linear-gradient(135deg, #3b82f6, #2563eb); }

@keyframes slideIn {
    to { transform: translateX(0); }
}

/* Header Section */
.header-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.header-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.header-text h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #ffffff, #f0f9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-text h1 i {
    margin-right: 1rem;
    background: linear-gradient(45deg, #60a5fa, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-description {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    line-height: 1.7;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    text-align: center;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Premium Badges */
.premium-badges {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.badge.premium {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #1a1a1a;
}

.badge.security {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.badge.multi {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Templates Section */
.templates-section {
    margin-bottom: 3rem;
}

.templates-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: #1f2937;
}

.templates-section h2 i {
    margin-right: 1rem;
    background: linear-gradient(45deg, #8b5cf6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.template-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(139, 92, 246, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-card:hover::before {
    opacity: 1;
}

.template-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -12px rgba(139, 92, 246, 0.25);
}

.template-card.active {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.3);
}

.template-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.template-icon i {
    font-size: 2rem;
    color: white;
}

.template-content {
    position: relative;
    z-index: 1;
}

.template-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.template-content p {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.template-settings {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

/* Scanner Interface */
.scanner-interface {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
}

/* Upload Section */
.upload-zone {
    border: 3px dashed #e2e8f0;
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    background: linear-gradient(135deg, #fafbfc 0%, #f1f5f9 100%);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    transform: scale(1.02);
}

.upload-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

.upload-icon i {
    font-size: 3rem;
    color: white;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.upload-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.upload-content p {
    color: #6b7280;
    margin-bottom: 2rem;
}

.upload-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.upload-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 160px;
    justify-content: center;
}

.upload-btn.primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.upload-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.upload-btn.secondary {
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.upload-btn.secondary:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: #faf5ff;
}

.upload-btn.tertiary {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.upload-btn.tertiary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}

.upload-btn.quaternary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.upload-btn.quaternary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.quick-action {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-action:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: #faf5ff;
    transform: translateY(-2px);
}

.quick-action i {
    font-size: 1rem;
}

/* Processing Area */
.processing-area {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.document-queue {
    background: #f8fafc;
    border-radius: 16px;
    padding: 1.5rem;
}

.document-queue h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.queue-item {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.queue-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.queue-item.active {
    border-color: #8b5cf6;
}

.queue-item-thumbnail {
    width: 60px;
    height: 80px;
    border-radius: 8px;
    background: #f3f4f6;
    margin-bottom: 0.75rem;
    background-size: cover;
    background-position: center;
}

.queue-item-info {
    font-size: 0.875rem;
}

.queue-item-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.queue-item-size {
    color: #6b7280;
}

/* Editor Container */
.editor-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.document-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.doc-name {
    font-weight: 600;
    color: #1f2937;
}

.doc-size {
    color: #6b7280;
    font-size: 0.875rem;
}

.editor-tools {
    display: flex;
    gap: 0.5rem;
}

.tool-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: #faf5ff;
}

.tool-btn.active {
    background: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}

/* Editor Workspace */
.editor-workspace {
    display: grid;
    grid-template-columns: 1fr 350px;
    min-height: 500px;
}

.canvas-container {
    position: relative;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#editor-canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* Crop Overlay */
.crop-overlay {
    position: absolute;
    border: 2px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    pointer-events: none;
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #8b5cf6;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
}

.crop-handle.tl { top: -6px; left: -6px; }
.crop-handle.tr { top: -6px; right: -6px; }
.crop-handle.bl { bottom: -6px; left: -6px; }
.crop-handle.br { bottom: -6px; right: -6px; }

/* Enhancement Panel */
.enhancement-panel {
    background: #f8fafc;
    padding: 2rem;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.panel-header h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.preset-buttons {
    display: flex;
    gap: 0.25rem;
    background: #e5e7eb;
    padding: 0.25rem;
    border-radius: 8px;
}

.preset-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover,
.preset-btn.active {
    background: white;
    color: #8b5cf6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.control-groups {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.control-group h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.slider-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.slider-control label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    min-width: 100px;
}

.slider-control input[type="range"] {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    appearance: none;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.slider-control .value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #8b5cf6;
    min-width: 40px;
    text-align: center;
}

.checkbox-control,
.radio-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.checkbox-control input[type="checkbox"],
.radio-control input[type="radio"] {
    display: none;
}

.checkmark,
.radio-mark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-mark {
    border-radius: 50%;
}

.checkbox-control input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: #8b5cf6;
}

.radio-control input[type="radio"]:checked + .radio-mark {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: #8b5cf6;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkbox-control input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1;
}

.radio-mark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.radio-control input[type="radio"]:checked + .radio-mark::after {
    opacity: 1;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.action-btn.primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.action-btn.secondary {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.action-btn.secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Export Section */
.export-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
}

.export-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.export-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.batch-info {
    color: #6b7280;
    font-size: 0.875rem;
}

.export-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.format-selection h4,
.quality-settings h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.format-option {
    padding: 1.5rem 1rem;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-option:hover {
    border-color: #8b5cf6;
    background: #faf5ff;
}

.format-option.active {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

.format-option i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #8b5cf6;
}

.format-option span {
    font-weight: 600;
    color: #374151;
}

.quality-control,
.resolution-control {
    margin-bottom: 1.5rem;
}

.quality-control label,
.resolution-control label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.quality-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quality-control input[type="range"] {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    appearance: none;
}

.quality-value {
    font-weight: 600;
    color: #8b5cf6;
    min-width: 50px;
    text-align: center;
}

.resolution-control select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 0.875rem;
    color: #374151;
}

.export-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.export-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 140px;
    justify-content: center;
}

.export-btn.primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.export-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.export-btn.secondary {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.export-btn.secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

.export-btn.tertiary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.export-btn.tertiary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* OCR Panel */
.ocr-panel {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
}

.ocr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.ocr-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ocr-controls {
    display: flex;
    gap: 0.5rem;
}

.ocr-btn {
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ocr-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.confidence-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.confidence-score {
    font-weight: 600;
    color: #10b981;
}

.extracted-text {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
}

/* Help Section */
.help-section {
    margin-bottom: 3rem;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.help-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.help-card:hover {
    transform: translateY(-4px);
}

.help-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.help-icon i {
    font-size: 1.5rem;
    color: white;
}

.help-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.help-content p {
    color: #6b7280;
    line-height: 1.6;
}

/* Blog Section */
.blog-section {
    margin-bottom: 3rem;
}

.blog-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: #1f2937;
    margin-bottom: 3rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.blog-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.blog-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.blog-card ul {
    list-style: none;
    padding: 0;
}

.blog-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.5;
}

.blog-card li:last-child {
    border-bottom: none;
}

.blog-card strong {
    color: #8b5cf6;
    font-weight: 600;
}

/* Loading States */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.processing-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 300px;
}

.processing-content h3 {
    margin-top: 1rem;
    color: #1f2937;
    font-weight: 600;
}

.processing-content p {
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    margin-bottom: 0.5rem;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 1.5rem;
    }
    
    .header-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .header-text h1 {
        font-size: 3rem;
    }
    
    .processing-area {
        grid-template-columns: 250px 1fr;
    }
    
    .editor-workspace {
        grid-template-columns: 1fr 300px;
    }
}

@media (max-width: 768px) {
    .scanner-page {
        padding: 1rem 0;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .header-section {
        padding: 2rem 1.5rem;
    }
    
    .header-text h1 {
        font-size: 2.5rem;
    }
    
    .header-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .templates-section h2 {
        font-size: 2rem;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .template-card {
        padding: 1.5rem;
    }
    
    .scanner-interface,
    .export-section,
    .ocr-panel {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
    }
    
    .upload-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .upload-btn {
        width: 100%;
        max-width: 280px;
    }
    
    .processing-area {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .document-queue {
        order: 2;
    }
    
    .editor-container {
        order: 1;
    }
    
    .editor-workspace {
        grid-template-columns: 1fr;
    }
    
    .enhancement-panel {
        order: 2;
    }
    
    .canvas-container {
        order: 1;
        min-height: 300px;
    }
    
    .export-options {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .format-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .export-actions {
        flex-direction: column;
    }
    
    .export-btn {
        width: 100%;
    }
    
    .help-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-section h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .header-text h1 {
        font-size: 2rem;
    }
    
    .header-description {
        font-size: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .templates-section h2,
    .blog-section h2 {
        font-size: 1.75rem;
    }
    
    .template-card,
    .help-card,
    .blog-card {
        padding: 1.25rem;
    }
    
    .format-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .preset-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .control-groups {
        gap: 1.5rem;
    }
    
    .slider-control {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .slider-control label {
        min-width: auto;
        text-align: center;
    }
}

/* Print Styles */
@media print {
    .scanner-page {
        background: white;
    }
    
    .header-section,
    .templates-section,
    .scanner-interface,
    .processing-area,
    .export-section {
        break-inside: avoid;
    }
    
    .notification-container,
    .upload-buttons,
    .editor-tools,
    .action-buttons,
    .export-actions,
    .ocr-controls {
        display: none;
    }
    
    #editor-canvas,
    .extracted-text {
        box-shadow: none;
        border: 1px solid #d1d5db;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .upload-icon,
    .template-icon,
    .help-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .upload-icon {
        animation: none;
    }
    
    .header-section::before {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    }
    
    .scanner-interface,
    .export-section,
    .ocr-panel,
    .help-card,
    .blog-card,
    .template-card,
    .editor-container,
    .queue-item {
        background: #374151;
        color: #f9fafb;
    }
    
    .document-queue,
    .enhancement-panel {
        background: #4b5563;
    }
    
    .upload-zone {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
        border-color: #6b7280;
    }
    
    .format-option {
        background: #4b5563;
        border-color: #6b7280;
    }
}

/* Accessibility Improvements */
.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;
}

/* Focus Styles */
.upload-btn:focus,
.tool-btn:focus,
.action-btn:focus,
.export-btn:focus,
.ocr-btn:focus,
.preset-btn:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

input[type="range"]:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.template-card:focus,
.format-option:focus,
.queue-item:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}
