* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding-top: 80px; /* Account for fixed navbar */
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 2rem 0;
}

.hero {
    margin-bottom: 3rem;
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #667eea;
    background-color: #f7fafc;
}

.upload-area.dragover {
    border-color: #667eea;
    background-color: #ebf8ff;
    transform: scale(1.02);
}

.upload-content h2 {
    margin: 1rem 0;
    color: #2d3748;
    font-size: 1.5rem;
}

.upload-content p {
    color: #718096;
    margin-bottom: 1.5rem;
}

.upload-icon {
    color: #a0aec0;
    margin-bottom: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.features {
    margin-bottom: 3rem;
}

.features h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #2d3748;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-category {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.feature-category h3 {
    margin-bottom: 1.5rem;
    color: #2d3748;
    font-size: 1.3rem;
}

.feature-links {
    display: grid;
    gap: 0.5rem;
}

.feature-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f7fafc;
    border-radius: 8px;
    text-decoration: none;
    color: #4a5568;
    transition: all 0.3s ease;
}

.feature-link:hover {
    background: #edf2f7;
    transform: translateX(4px);
    color: #2d3748;
}

.feature-link .icon {
    margin-right: 12px;
    font-size: 1.2rem;
}

.info-section {
    margin-bottom: 3rem;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.info-card h3 {
    margin-bottom: 1rem;
    color: #2d3748;
    font-size: 1.2rem;
}

.info-card p {
    color: #718096;
}

.use-cases h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #2d3748;
}

.use-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.use-case {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.use-case h4 {
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.use-case p {
    color: #718096;
    font-size: 0.9rem;
}

footer {
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Removed file-processor styles */

.file-list {
    margin-top: 2rem;
}

.file-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
    min-height: 120px;
}

.file-preview-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.file-preview {
    width: 150px;
    height: 100px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.preview-placeholder {
    text-align: center;
    color: #a0aec0;
}

.preview-placeholder svg {
    margin-bottom: 0.5rem;
}

.preview-placeholder p {
    font-size: 0.8rem;
    margin: 0;
}

.preview-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.preview-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-image canvas,
.preview-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem;
}

.document-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.text-preview {
    font-size: 0.7rem;
    color: #4a5568;
    line-height: 1.2;
    max-height: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spreadsheet-preview {
    font-size: 0.7rem;
    color: #4a5568;
}

.spreadsheet-preview p {
    margin: 0.2rem 0;
}

.preview-info {
    background: #edf2f7;
    padding: 0.25rem 0.5rem;
    border-radius: 0 0 4px 4px;
    text-align: center;
}

.preview-info p {
    margin: 0.1rem 0;
    font-size: 0.7rem;
    color: #2d3748;
}

.preview-info strong {
    font-weight: 600;
}

.preview-error {
    text-align: center;
    color: #e53e3e;
    padding: 1rem;
}

.preview-error svg {
    margin-bottom: 0.5rem;
}

.preview-error p {
    font-size: 0.8rem;
    margin: 0;
}

.file-info {
    display: flex;
    align-items: center;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: #667eea;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 1rem;
}

.file-details h4 {
    margin-bottom: 0.25rem;
    color: #2d3748;
}

.file-details p {
    color: #718096;
    font-size: 0.9rem;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-danger {
    background: #fed7d7;
    color: #c53030;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #feb2b2;
}

.processing {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-message {
    background: #c6f6d5;
    color: #22543d;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        min-height: auto;
    }
    
    .file-preview-container {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        text-align: center;
    }
    
    .file-preview {
        width: 120px;
        height: 80px;
        margin: 0 auto;
    }
    
    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .preview-demo div[style*="grid-template-columns: 1fr auto 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        text-align: center !important;
    }
    
    .preview-showcase div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .conversion-preview-desktop {
        display: none !important;
    }
    
    .conversion-preview-mobile {
        display: block !important;
    }
    
    .preview-conversion-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .preview-conversion-grid > div:nth-child(2) {
        order: 3;
        margin-top: 1rem;
    }
    
    .preview-conversion-grid > div:nth-child(2) > div:first-child {
        width: 60px !important;
        height: 60px !important;
        margin: 0 auto 1rem auto;
    }
}

/* Enhanced PDF Reorder Styles */
.reorder-toolbar {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    border-right: 1px solid #e2e8f0;
}

.toolbar-section:last-child {
    border-right: none;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.toolbar-btn:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toolbar-btn.btn-danger {
    color: #c53030;
    border-color: #fed7d7;
}

.toolbar-btn.btn-danger:hover:not(:disabled) {
    background: #fed7d7;
}

.zoom-label {
    font-size: 0.875rem;
    color: #4a5568;
    margin-right: 0.5rem;
}

.zoom-level {
    min-width: 50px;
    text-align: center;
    font-size: 0.875rem;
    color: #2d3748;
    font-weight: 600;
}

.pages-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.page-item {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #f7fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}

.page-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.page-item.selected {
    border-color: #667eea;
    background: #ebf8ff;
}

.page-item.dragging {
    opacity: 0.7;
    transform: rotate(5deg);
}

.page-thumbnail {
    position: relative;
    text-align: center;
    margin-bottom: 0.5rem;
    transform-origin: center;
    transition: transform 0.3s ease;
}

.page-thumbnail canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-number-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.page-selection-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.page-selection-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.page-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.page-info span {
    font-size: 0.875rem;
    color: #2d3748;
    font-weight: 600;
}

.original-page {
    font-size: 0.75rem !important;
    color: #718096 !important;
    font-weight: normal !important;
}

.no-pages-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #a0aec0;
}

.no-pages-message svg {
    margin-bottom: 1rem;
}

.no-pages-message h3 {
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.rotation-info {
    font-size: 0.7rem !important;
    color: #667eea !important;
    font-weight: 600 !important;
}

.page-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #e53e3e;
    text-align: center;
}

.page-error svg {
    margin-bottom: 0.5rem;
}

.loading-indicator {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #4a5568;
}

.loading-indicator .spinner {
    margin-bottom: 1rem;
}

/* Accessibility improvements */
.page-item:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.page-item[aria-selected="true"] {
    border-color: #667eea;
    background: #ebf8ff;
}

/* Enhanced PDF Delete Styles */
.delete-toolbar {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.delete-toolbar .toolbar-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    border-right: 1px solid #e2e8f0;
}

.delete-toolbar .toolbar-section:last-child {
    border-right: none;
}

.smart-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
    color: white !important;
    border-color: #48bb78 !important;
}

.smart-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%) !important;
}

.range-input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-input-container label {
    font-size: 0.875rem;
    color: #4a5568;
    white-space: nowrap;
}

.range-input-container input {
    width: 120px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.875rem;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.search-container input {
    width: 180px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.875rem;
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: #f7fafc;
    border-radius: 6px;
    padding: 2px;
}

.view-btn {
    padding: 6px 8px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
}

.view-btn.active,
.view-btn:hover {
    background: white;
    color: #2d3748;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.delete-pages-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.pages-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
}

.pages-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pages-stats .selected-pages {
    color: #667eea;
}

.pages-stats .deleted-pages {
    color: #e53e3e;
}

.pages-stats .remaining-pages {
    color: #48bb78;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.pages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

.grid-item {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #f7fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f7fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}

.list-item .page-thumbnail {
    flex-shrink: 0;
    width: 80px;
}

.list-item .page-info {
    flex: 1;
    text-align: left;
}

.page-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.page-item.selected {
    border-color: #667eea;
    background: #ebf8ff;
}

.page-item.deleted {
    opacity: 0.5;
    border-color: #e53e3e;
    background: #fed7d7;
}

.page-item.blank-page {
    border-left: 4px solid #fbbf24;
}

.page-item.duplicate-page {
    border-left: 4px solid #f56565;
}

.page-indicators {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    z-index: 3;
}

.blank-indicator,
.duplicate-indicator {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
}

.page-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.page-number {
    font-size: 0.875rem;
    color: #2d3748;
    font-weight: 600;
}

.page-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}

.blank-tag {
    background: #fbbf24;
}

.duplicate-tag {
    background: #f56565;
}

.page-text-preview {
    font-size: 0.7rem;
    color: #718096;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Preview Panel Styles */
.preview-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.preview-panel.hidden {
    display: none;
}

.preview-panel > div {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.preview-header h3 {
    margin: 0;
    color: #2d3748;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #718096;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #2d3748;
}

.preview-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.preview-section {
    margin-bottom: 2rem;
}

.preview-section h4 {
    margin-bottom: 1rem;
    color: #2d3748;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.preview-pages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.deleted-preview {
    background: #fed7d7;
}

.remaining-preview {
    background: #c6f6d5;
}

.preview-page-item {
    text-align: center;
}

.mini-thumbnail {
    position: relative;
    display: inline-block;
}

.mini-thumbnail canvas {
    width: 40px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mini-thumbnail .page-number {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #2d3748;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
}

.preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Notification Styles */
.notification {
    animation: slideIn 0.3s ease-out;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .delete-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .delete-toolbar .toolbar-section {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 0.5rem 0;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .delete-toolbar .toolbar-section:last-child {
        border-bottom: none;
    }
    
    .pages-stats {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .range-input-container input,
    .search-container input {
        width: 100px;
    }
    
    .preview-panel {
        padding: 1rem;
    }
    
    .preview-pages {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }
}

/* Enhanced PDF Add Pages Styles */
.add-pages-toolbar {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.add-pages-toolbar .toolbar-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    border-right: 1px solid #e2e8f0;
}

.add-pages-toolbar .toolbar-section:last-child {
    border-right: none;
}

.content-type-selector {
    display: flex;
    gap: 0.5rem;
    background: #f7fafc;
    border-radius: 8px;
    padding: 4px;
}

.content-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    white-space: nowrap;
}

.content-btn:hover,
.content-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.view-controls {
    display: flex;
    gap: 0.25rem;
    background: #f7fafc;
    border-radius: 6px;
    padding: 2px;
}

.view-btn {
    padding: 6px 10px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
}

.view-btn.active,
.view-btn:hover {
    background: white;
    color: #2d3748;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zoom-display {
    min-width: 50px;
    text-align: center;
    font-size: 0.875rem;
    color: #2d3748;
    font-weight: 600;
}

/* Content Creation Panel */
.content-creation-panel {
    background: white;
    border-radius: 12px;
    margin: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.content-creation-panel.visible {
    max-height: 800px;
    padding: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.panel-header h3 {
    margin: 0;
    color: #2d3748;
}

.panel-content {
    padding: 1.5rem;
}

.creator-section {
    max-width: 100%;
}

.creator-section h4 {
    margin-bottom: 1rem;
    color: #2d3748;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.size-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.size-inputs input {
    flex: 1;
}

.size-inputs span {
    color: #718096;
    font-weight: 600;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-picker input[type="color"] {
    width: 40px;
    height: 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-label {
    font-size: 0.875rem;
    color: #4a5568;
}

.margin-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.margin-inputs input {
    width: 100%;
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin: 1rem 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: #667eea;
    background-color: #f0f9ff;
}

.file-drop-zone svg {
    color: #a0aec0;
    margin-bottom: 1rem;
}

.file-drop-zone p {
    color: #718096;
    margin-bottom: 1rem;
}

/* Template Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.template-card {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-card:hover,
.template-card.active {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.template-preview {
    height: 100px;
    background: #f7fafc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    color: #a0aec0;
}

.template-info h5 {
    margin: 0.5rem 0 0.25rem 0;
    color: #2d3748;
}

.template-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #718096;
}

/* Insertion Interface */
.insertion-interface {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin: 2rem 0;
}

.document-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
}

.document-stats .insertion-count {
    color: #667eea;
}

.document-stats .final-count {
    color: #48bb78;
}

.pages-container {
    min-height: 300px;
}

.pages-container.visual-mode {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.pages-container.list-mode {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-element {
    transition: all 0.3s ease;
}

.visual-page {
    text-align: center;
}

.list-page {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.list-page .page-thumbnail {
    flex-shrink: 0;
    width: 80px;
}

.list-page .page-info {
    flex: 1;
    text-align: left;
}

.page-thumbnail {
    position: relative;
    display: inline-block;
    margin-bottom: 0.5rem;
    transform-origin: center;
    transition: transform 0.3s ease;
}

.page-thumbnail canvas {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-number-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.page-type-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    z-index: 2;
}

.page-type-indicator.original {
    background: #48bb78;
}

.page-type-indicator.blank {
    background: #a0aec0;
}

.page-type-indicator.image {
    background: #ed8936;
}

.page-type-indicator.text {
    background: #667eea;
}

.page-type-indicator.template {
    background: #9f7aea;
}

.page-info {
    text-align: center;
}

.page-title {
    display: block;
    font-size: 0.875rem;
    color: #2d3748;
    font-weight: 600;
}

.page-type {
    display: block;
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.25rem;
}

/* Insertion Points */
.insertion-point {
    position: relative;
    margin: 1rem 0;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.insertion-point:hover,
.insertion-point.selected {
    opacity: 1;
}

.insertion-point.drag-over {
    opacity: 1;
    transform: scale(1.05);
}

.insertion-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.insertion-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    margin: 0 1rem;
}

.insertion-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 16px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 20px;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.insertion-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.insertion-text {
    display: none;
}

.insertion-point:hover .insertion-text {
    display: inline;
}

.insertion-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #0ea5e9;
}

.insertion-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.insertion-thumbnail {
    width: 60px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border-radius: 4px;
    overflow: hidden;
}

.insertion-thumbnail canvas {
    max-width: 100%;
    max-height: 100%;
}

.placeholder-thumbnail {
    font-size: 0.7rem;
    color: #a0aec0;
    text-transform: uppercase;
    font-weight: 600;
}

.insertion-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.insertion-type {
    font-size: 0.875rem;
    color: #4a5568;
    font-weight: 600;
    text-transform: capitalize;
}

.remove-insertion-btn {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.remove-insertion-btn:hover {
    background: #fed7d7;
}

/* Preview Panel */
.preview-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.preview-panel.hidden {
    display: none;
}

.preview-panel > div {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.preview-header h3 {
    margin: 0;
    color: #2d3748;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    background: none;
    border: 1px solid #e2e8f0;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #4a5568;
    transition: all 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #718096;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #2d3748;
    background: #f7fafc;
}

.preview-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-page {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-page canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

/* Mobile Controls */
.mobile-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

.mobile-fab-container {
    position: relative;
}

.mobile-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.mobile-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.mobile-fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.mobile-fab-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.mobile-fab-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 16px;
    background: white;
    border: none;
    border-radius: 25px;
    color: #4a5568;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 600;
}

.mobile-fab-item:hover {
    background: #f7fafc;
    transform: translateX(-4px);
}

.mobile-gesture-help {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999;
}

.help-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.help-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.mobile-context-menu {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1001;
}

.context-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    color: #4a5568;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f7fafc;
}

.context-menu-item:last-child {
    border-bottom: none;
}

.context-menu-item:hover {
    background: #f7fafc;
}

/* Image Preview */
.image-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    /*max-height: 200px;*/
    overflow-y: auto;
}

.image-preview-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.image-preview-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.image-preview-item span {
    flex: 1;
    font-size: 0.875rem;
    color: #4a5568;
}

/* Text Preview */
.text-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    font-family: Arial, sans-serif;
}

/* Responsive Design */
@media (max-width: 768px) {
    .add-pages-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .add-pages-toolbar .toolbar-section {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 0.5rem 0;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .add-pages-toolbar .toolbar-section:last-child {
        border-bottom: none;
    }
    
    .content-type-selector {
        flex-wrap: wrap;
    }
    
    .content-btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .document-stats {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .pages-container.visual-mode {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
    
    .margin-inputs {
        grid-template-columns: 1fr;
    }
    
    .size-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .insertion-text {
        display: none !important;
    }
    
    .preview-panel {
        padding: 1rem;
    }
    
    .preview-content {
        padding: 1rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .toolbar-btn,
    .content-btn,
    .view-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .insertion-btn {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    .template-card {
        min-height: 120px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.notification {
    animation: slideIn 0.3s ease-out;
}

.insertion-item {
    animation: fadeIn 0.3s ease-out;
}

/* No document message */
.no-document-message {
    text-align: center;
    padding: 3rem;
    color: #a0aec0;
}

.no-document-message svg {
    margin-bottom: 1rem;
}

.no-document-message h3 {
    margin-bottom: 0.5rem;
    color: #4a5568;
}

/* Remove button styling */
.remove-btn {
    background: #e53e3e;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.remove-btn:hover {
    background: #c53030;
}

/* Mobile responsiveness for reorder interface */
@media (max-width: 768px) {
    .reorder-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-section {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 0.5rem 0;
        justify-content: center;
    }
    
    .toolbar-section:last-child {
        border-bottom: none;
    }
    
    .pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .page-item {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .upload-content h2 {
        font-size: 1.2rem;
    }
    
    .features h2,
    .use-cases h2 {
        font-size: 1.5rem;
    }
    
    .btn-primary {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .toolbar-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .toolbar-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Enhanced Add Pages - Camera Capture Styles */
.camera-capture-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.camera-capture-modal.visible {
    opacity: 1;
    visibility: visible;
}

.camera-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.camera-video {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: cover;
}

.camera-preview {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.camera-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
}

.capture-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid #667eea;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.capture-btn:hover {
    background: #667eea;
    color: white;
}

.capture-btn:active {
    transform: scale(0.95);
}

.camera-flip-btn,
.camera-close-btn {
    padding: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.camera-flip-btn:hover,
.camera-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Image Editor Styles */
.image-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-editor-modal.visible {
    opacity: 1;
    visibility: visible;
}

.image-editor-container {
    width: 95vw;
    height: 95vh;
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.image-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafc;
}

.image-editor-title {
    margin: 0;
    color: #2d3748;
    font-size: 1.125rem;
}

.image-editor-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.editor-tool-group {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: white;
    border-radius: 6px;
    align-items: center;
}

.editor-tool-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4a5568;
    font-size: 0.875rem;
}

.editor-tool-btn:hover,
.editor-tool-btn.active {
    background: #667eea;
    color: white;
}

.image-editor-canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f0f0f0;
    overflow: auto;
}

.image-editor-canvas {
    max-width: 100%;
    max-height: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-editor-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
}

.editor-slider-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-slider-group label {
    font-size: 0.875rem;
    color: #4a5568;
    min-width: 70px;
}

.editor-slider {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    transition: background 0.2s ease;
}

.editor-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.editor-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Mobile Camera Styles */
@media (max-width: 768px) {
    .camera-container {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .camera-video {
        max-height: 80vh;
    }
    
    .camera-controls {
        padding: 0.75rem;
    }
    
    .capture-btn {
        width: 50px;
        height: 50px;
    }
    
    .image-editor-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .image-editor-toolbar {
        padding: 0.75rem;
        gap: 0.25rem;
    }
    
    .editor-tool-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .editor-slider-group {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .editor-slider-group label {
        min-width: auto;
        font-size: 0.8rem;
        text-align: center;
    }
    
    .editor-slider {
        width: 100px;
    }
}

/* Touch Gesture Styles */
.touch-gesture-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.gesture-indicator {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.3);
    border: 2px solid #667eea;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: gestureRipple 0.6s ease-out;
}

@keyframes gestureRipple {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.pinch-zoom-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pinch-zoom-indicator.visible {
    opacity: 1;
}

/* Template Preview Enhancements */
.template-preview.signature {
    background: linear-gradient(45deg, #f7fafc 25%, transparent 25%), 
                linear-gradient(-45deg, #f7fafc 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f7fafc 75%), 
                linear-gradient(-45deg, transparent 75%, #f7fafc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.template-preview.lined {
    background: linear-gradient(to bottom, transparent 90%, #e2e8f0 90%);
    background-size: 100% 24px;
}

.template-preview.grid {
    background: linear-gradient(to right, #e2e8f0 1px, transparent 1px),
                linear-gradient(to bottom, #e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
}

.template-preview.dotted {
    background-image: radial-gradient(circle, #e2e8f0 1px, transparent 1px);
    background-size: 15px 15px;
}

.template-preview.calendar {
    background: linear-gradient(to right, #e2e8f0 1px, transparent 1px),
                linear-gradient(to bottom, #e2e8f0 1px, transparent 1px);
    background-size: 14.28% 16.66%;
}

.template-preview.notes {
    background: linear-gradient(to bottom, transparent 85%, #e2e8f0 85%, #e2e8f0 90%, transparent 90%);
    background-size: 100% 40px;
}

/* Content Type Animations */
.content-type-transition {
    animation: contentTypeSlide 0.3s ease-out;
}

@keyframes contentTypeSlide {
    0% {
        transform: translateX(-20px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Success/Error States */
.success-message {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #22543d;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    color: #822727;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Enhanced PDF Compression Styles */

/* Enhanced Upload Interface */
.enhanced-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.upload-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-animation {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 3px solid transparent;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 2s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area.processing .upload-animation {
    opacity: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.upload-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 0.875rem;
    color: #718096;
}

.file-limit {
    color: #e53e3e;
    font-weight: 600;
}

.format-support {
    color: #38a169;
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
    justify-content: center;
}

.or-divider {
    position: relative;
    color: #a0aec0;
    font-size: 0.875rem;
    margin: 1rem 0;
}

.or-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -60px;
    right: -60px;
    height: 1px;
    background: #e2e8f0;
    z-index: -1;
}

.or-divider::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -20px;
    right: -20px;
    height: 20px;
    background: white;
    z-index: -1;
}

.demo-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 160px;
    justify-content: center;
}

/* Advanced Options Panel */
.compression-options-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.options-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.collapse-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.collapse-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.collapse-btn svg {
    transition: transform 0.3s ease;
}

.options-content {
    padding: 2rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.option-group {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.option-group:hover {
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.group-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

/* Compression Levels */
.compression-levels {
    display: grid;
    gap: 0.75rem;
}

.level-option {
    position: relative;
}

.level-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.level-option label {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level-option input[type="radio"]:checked + label {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.level-option label:hover {
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.level-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.level-info {
    flex: 1;
}

.level-info strong {
    display: block;
    color: #2d3748;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.level-info span {
    color: #718096;
    font-size: 0.875rem;
}

/* Sliders */
.slider-group {
    margin-bottom: 1rem;
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
}

.quality-slider,
.dpi-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    transition: background 0.2s ease;
    appearance: none;
}

.quality-slider::-webkit-slider-thumb,
.dpi-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.quality-slider::-webkit-slider-thumb:hover,
.dpi-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.quality-slider::-moz-range-thumb,
.dpi-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

/* Checkboxes */
.checkbox-group {
    margin-bottom: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: #2d3748;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    position: relative;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Password Input */
.password-input {
    margin-bottom: 1rem;
}

.password-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding: 10px 45px 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.password-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #667eea;
}

/* Encryption Select */
.encryption-select {
    margin-bottom: 1rem;
}

.encryption-select label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
}

.encryption-select select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.encryption-select select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Options Footer */
.options-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    gap: 1rem;
}

.preset-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Progress Panel */
.progress-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    overflow: hidden;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #38a169 0%, #48bb78 100%);
    color: white;
}

.progress-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.progress-controls {
    display: flex;
    gap: 0.5rem;
}

.progress-controls button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 12px;
    font-size: 0.875rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
    transform: translateY(-1px);
}

.progress-content {
    padding: 1.5rem 2rem;
    max-height: 400px;
    overflow-y: auto;
}

/* Progress Items */
.progress-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.progress-item.completed {
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    border-left: 4px solid #38a169;
}

.progress-item.error {
    background: linear-gradient(135deg, #fed7d7 0%, #fbb6ce 100%);
    border-left: 4px solid #e53e3e;
}

.progress-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.file-details {
    font-size: 0.875rem;
    color: #718096;
}

.progress-status {
    flex: 1;
    min-width: 200px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: #4a5568;
    font-weight: 500;
}

.progress-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 6px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-small:hover {
    transform: translateY(-1px);
}

/* Results Panel */
.results-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    overflow: hidden;
}

.results-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.results-header h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.results-summary {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.summary-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 1rem;
    border-radius: 8px;
    min-width: 100px;
}

.stat-item.error {
    background: rgba(229, 62, 62, 0.2);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.results-content {
    padding: 1.5rem 2rem;
    max-height: 500px;
    overflow-y: auto;
}

/* Result Items */
.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.result-item.completed {
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    border-left: 4px solid #38a169;
}

.result-item.error {
    background: linear-gradient(135deg, #fed7d7 0%, #fbb6ce 100%);
    border-left: 4px solid #e53e3e;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-info .file-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.compression-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.875rem;
}

.stat {
    color: #4a5568;
    font-family: 'Monaco', 'Menlo', monospace;
}

.compression-ratio {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
}

.compression-ratio.excellent {
    background: #c6f6d5;
    color: #22543d;
}

.compression-ratio.good {
    background: #bee3f8;
    color: #2a4365;
}

.compression-ratio.moderate {
    background: #fbb6ce;
    color: #97266d;
}

.compression-ratio.low {
    background: #fed7cc;
    color: #c05621;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e53e3e;
    font-size: 0.875rem;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

.results-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 1rem;
}

/* Validation Errors */
.validation-errors {
    background: linear-gradient(135deg, #fed7d7 0%, #fbb6ce 100%);
    border: 2px solid #e53e3e;
    border-radius: 12px;
    margin: 1rem 0;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #e53e3e;
    color: white;
}

.error-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.error-list {
    padding: 1.5rem;
}

.error-item {
    margin-bottom: 1rem;
}

.error-item:last-child {
    margin-bottom: 0;
}

.error-item strong {
    color: #c53030;
    display: block;
    margin-bottom: 0.5rem;
}

.error-item ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #822727;
}

.error-item li {
    margin-bottom: 0.25rem;
}

/* Password Modal */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-body {
    padding: 2rem;
}

.modal-body p {
    margin-bottom: 1.5rem;
    color: #4a5568;
    line-height: 1.6;
}

.modal-password-input {
    width: 100%;
    padding: 12px 45px 12px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.modal-password-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.password-error {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 6px;
    color: #c53030;
    font-size: 0.875rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .options-header {
        padding: 1rem 1.5rem;
    }
    
    .options-content {
        padding: 1.5rem;
    }
    
    .compression-levels {
        gap: 0.5rem;
    }
    
    .level-option label {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .level-icon {
        font-size: 1.25rem;
    }
    
    .options-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .preset-btn {
        width: 100%;
        justify-content: center;
    }
    
    .progress-item,
    .result-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .progress-status {
        min-width: auto;
    }
    
    .progress-actions,
    .result-actions {
        justify-content: center;
    }
    
    .results-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .summary-stats {
        justify-content: center;
        gap: 1rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 480px) {
    .enhanced-upload-content {
        gap: 1rem;
    }
    
    .upload-btn,
    .demo-btn {
        min-width: auto;
        width: 100%;
        max-width: 250px;
    }
    
    .option-group {
        padding: 1rem;
    }
    
    .level-option label {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .level-info strong {
        font-size: 0.9rem;
    }
    
    .level-info span {
        font-size: 0.8rem;
    }
    
    .compression-stats {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .progress-controls {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .progress-controls button {
        width: 100%;
        justify-content: center;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.keyboard-focused {
    outline: 2px solid #667eea !important;
    outline-offset: 2px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .compression-options-panel,
    .progress-panel,
    .results-panel {
        border: 2px solid #000;
    }
    
    .level-option label {
        border-width: 3px;
    }
    
    .level-option input[type="radio"]:checked + label {
        border-color: #000;
        background: #fff;
    }
}

/* Enhanced OCR Styles */

/* Enhanced Upload Area */
.upload-visual {
    position: relative;
    margin-bottom: 1rem;
}

.scan-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 3px solid #667eea;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
}

.upload-area.scanning .scan-animation {
    animation: scanEffect 2s ease-in-out infinite;
}

@keyframes scanEffect {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.upload-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.upload-btn,
.camera-btn,
.url-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: center;
}

.supported-formats {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.format-badge {
    padding: 4px 12px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* OCR Options Panel */
.ocr-options-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    overflow: hidden;
}

.options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: white;
}

.options-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.options-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.options-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.options-content {
    padding: 2rem;
}

.option-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.option-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.option-section h4 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.1rem;
}

/* Language Grid */
.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.language-option:hover {
    background: #e0f2fe;
    border-color: #0ea5e9;
}

.language-option input[type="checkbox"] {
    margin-right: 0.5rem;
}

.language-option input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #0ea5e9;
}

/* Enhancement Controls */
.enhancement-controls {
    display: grid;
    gap: 1rem;
}

.slider-control {
    margin-bottom: 1rem;
}

.slider-control label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #475569;
}

.slider-value {
    background: #e0f2fe;
    color: #0284c7;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    min-width: 40px;
    text-align: center;
}

.slider-control input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    appearance: none;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0ea5e9;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.checkbox-controls {
    display: grid;
    gap: 0.75rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Format Grid */
.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.format-option {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-align: center;
}

.format-option:hover {
    background: #e0f2fe;
    border-color: #0ea5e9;
}

.format-option input[type="radio"] {
    display: none;
}

.format-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #0ea5e9;
}

/* Advanced Options */
.advanced-options {
    display: grid;
    gap: 0.75rem;
}

.options-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* OCR Preview Panel */
.ocr-preview-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.preview-header h3 {
    margin: 0;
    color: #1e293b;
}

.preview-controls {
    display: flex;
    gap: 0.5rem;
}

.zoom-btn,
.view-toggle {
    padding: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.zoom-btn:hover,
.view-toggle:hover {
    background: #f1f5f9;
    color: #334155;
}

.preview-content {
    padding: 1.5rem;
}

.preview-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.preview-original,
.preview-extracted {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem;
}

.preview-original h4,
.preview-extracted h4 {
    margin: 0 0 1rem 0;
    color: #334155;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.confidence-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.confidence-badge.high {
    background: #d1fae5;
    color: #065f46;
}

.confidence-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.confidence-badge.low {
    background: #fee2e2;
    color: #991b1b;
}

.preview-canvas-container {
    position: relative;
    overflow: auto;
    max-height: 400px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

#originalCanvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.region-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.extracted-text-container {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.ocr-word {
    display: inline;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ocr-word:hover {
    filter: brightness(0.9);
}

.processing-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #64748b;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.preview-progress {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9 0%, #2563eb 100%);
    transition: width 0.3s ease;
}

/* OCR Results Panel */
.ocr-results-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    overflow: hidden;
}

.results-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: white;
}

.results-header h3 {
    margin: 0 0 1rem 0;
}

.results-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.results-stats .stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.results-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 1rem;
}

.edit-tools,
.export-tools {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #475569;
}

.tool-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.tool-btn.primary {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
}

.tool-btn.primary:hover {
    background: #0284c7;
    border-color: #0284c7;
}

.results-content {
    padding: 2rem;
}

.text-editor {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 300px;
    max-height: 600px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #1e293b;
}

.text-editor:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.confidence-visualization {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.results-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.quality-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.info-label {
    font-weight: 600;
}

/* Camera Modal */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.camera-container {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.camera-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: white;
}

.camera-header h3 {
    margin: 0;
}

.camera-view {
    position: relative;
    background: #000;
}

#cameraVideo {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.camera-guides {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border: 2px dashed rgba(255, 255, 255, 0.5);
}

.guide-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid #0ea5e9;
}

.guide-corner.top-left {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.guide-corner.top-right {
    top: -2px;
    right: -2px;
    border-left: none;
    border-bottom: none;
}

.guide-corner.bottom-left {
    bottom: -2px;
    left: -2px;
    border-right: none;
    border-top: none;
}

.guide-corner.bottom-right {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

.camera-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    background: #1e293b;
}

.camera-switch,
.camera-settings {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.camera-switch:hover,
.camera-settings:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.capture-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid white;
    background: #0ea5e9;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.capture-btn:hover {
    transform: scale(1.05);
}

.capture-btn:active {
    transform: scale(0.95);
}

.capture-btn::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    animation: captureFlash 0.5s ease-out;
}

@keyframes captureFlash {
    0% {
        opacity: 0.8;
        transform: scale(0.8);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

.camera-tips {
    padding: 1rem;
    background: #f8fafc;
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.3s ease-out;
    z-index: 10001;
}

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

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.info {
    border-left: 4px solid #3b82f6;
}

.notification button {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #94a3b8;
    padding: 0;
    width: 24px;
    height: 24px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .upload-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .upload-btn,
    .camera-btn,
    .url-btn {
        width: 100%;
    }
    
    .language-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .format-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-split {
        grid-template-columns: 1fr;
    }
    
    .results-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .edit-tools,
    .export-tools {
        justify-content: center;
    }
    
    .results-stats {
        gap: 1rem;
    }
    
    .results-stats .stat {
        flex: 1 1 auto;
        min-width: 80px;
        text-align: center;
    }
    
    .camera-container {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .notification {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .options-header h3,
    .preview-header h3,
    .results-header h3 {
        font-size: 1.1rem;
    }
    
    .option-section h4 {
        font-size: 1rem;
    }
    
    .language-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .tool-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .camera-controls {
        gap: 1rem;
        padding: 1rem;
    }
    
    .capture-btn {
        width: 60px;
        height: 60px;
    }
    
    .camera-switch,
    .camera-settings {
        width: 40px;
        height: 40px;
    }
}

/* Enhanced PDF to Word Converter Styles */
.enhanced-pdf-converter {
    max-width: 1200px !important;
    margin: 0 auto !important;
    position: relative;
}

/* Format Selection */
.format-selector {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.format-btn {
    padding: 1rem 2rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.format-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.format-btn.active {
    border-color: #667eea;
    background: #f0f4ff;
    color: #667eea;
}

.format-btn .format-icon {
    font-size: 2rem;
}

.format-btn .format-name {
    font-weight: 600;
    text-transform: uppercase;
}

.format-btn .format-desc {
    font-size: 0.75rem;
    color: #718096;
}

/* Conversion Settings Panel */
.conversion-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    margin: 2rem 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.setting-group {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.setting-group h4 {
    margin-bottom: 1rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4a5568;
}

.setting-toggle {
    position: relative;
    width: 48px;
    height: 24px;
}

.setting-toggle input {
    display: none;
}

.setting-toggle .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: 0.3s;
    border-radius: 24px;
}

.setting-toggle .toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.setting-toggle input:checked + .toggle-slider {
    background-color: #667eea;
}

.setting-toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Page Selection */
.page-selection {
    margin: 2rem 0;
}

.page-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.page-thumbnail {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.page-thumbnail.selected {
    border-color: #667eea;
}

.page-thumbnail canvas {
    width: 100%;
    height: auto;
    display: block;
}

.page-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem;
    text-align: center;
    font-size: 0.75rem;
}

.page-select-checkbox {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Conversion Strategy Display */
.conversion-strategy {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.strategy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.strategy-icon {
    font-size: 1.5rem;
}

.strategy-details {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #0c4a6e;
}

/* Progress and Status */
.conversion-progress {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.progress-text {
    color: #4a5568;
    margin-top: 0.5rem;
}

/* Result Display */
.conversion-success {
    text-align: center;
    padding: 2rem;
}

.result-info {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    text-align: left;
}

.result-info p {
    margin: 0.5rem 0;
    color: #4a5568;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* OCR Settings */
.ocr-settings {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.ocr-language-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    background: white;
    margin-top: 0.5rem;
}

.ocr-confidence {
    margin-top: 1rem;
}

.confidence-slider {
    width: 100%;
    margin: 0.5rem 0;
}

.confidence-value {
    text-align: center;
    font-weight: 600;
    color: #92400e;
}

/* Batch Mode */
.batch-queue {
    max-height: 400px;
    overflow-y: auto;
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 1px solid #e2e8f0;
}

.queue-item.processing {
    border-color: #667eea;
    background: #f0f4ff;
}

.queue-item.completed {
    border-color: #10b981;
    background: #f0fdf4;
}

.queue-item.failed {
    border-color: #ef4444;
    background: #fef2f2;
}

.queue-item-name {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-status {
    margin-left: 1rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Profile Management */
.profile-manager {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.profile-list {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.profile-name {
    font-weight: 500;
    color: #2d3748;
}

.profile-actions {
    display: flex;
    gap: 0.5rem;
}

.profile-actions button {
    padding: 0.25rem 0.5rem;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

/* Camera Scan Modal */
.camera-scan-modal .modal-content {
    max-width: 600px;
}

.camera-container {
    position: relative;
    background: black;
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
}

#cameraVideo {
    width: 100%;
    height: auto;
    display: block;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.scan-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.camera-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.capture-tips {
    text-align: center;
    margin-top: 1rem;
    color: #718096;
    font-size: 0.875rem;
}

/* Cloud Save Modal */
.cloud-save-modal .modal-content {
    max-width: 400px;
}

.cloud-options {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.cloud-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cloud-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cloud-btn img {
    width: 32px;
    height: 32px;
}

/* History Display */
.conversion-history {
    max-height: 400px;
    overflow-y: auto;
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 1px solid #e2e8f0;
}

.history-item.success {
    border-left: 4px solid #10b981;
}

.history-item.failed {
    border-left: 4px solid #ef4444;
}

.history-filename {
    font-weight: 500;
    color: #2d3748;
}

.history-meta {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.25rem;
}

/* Preview Comparison */
.preview-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.preview-pane {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
}

.preview-pane h4 {
    margin-bottom: 1rem;
    color: #2d3748;
    text-align: center;
}

.preview-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 4px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-message {
    font-size: 1.1rem;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 10000;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification.info {
    background: #3182ce;
    color: white;
}

.notification.success {
    background: #10b981;
    color: white;
}

.notification.error {
    background: #ef4444;
    color: white;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .format-selector {
        flex-direction: column;
    }
    
    .format-btn {
        width: 100%;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-comparison {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions button {
        width: 100%;
    }
    
    .page-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .conversion-panel {
        padding: 1rem;
    }
    
    .notification {
        left: 10px;
        right: 10px;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .format-btn,
    .page-thumbnail,
    .setting-toggle,
    button {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    .format-btn:active {
        transform: scale(0.98);
    }
}

/* Document Structure Display */
.document-structure {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.structure-tree {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #4a5568;
}

.structure-node {
    padding: 0.25rem 0;
    cursor: pointer;
    transition: background 0.2s;
}

.structure-node:hover {
    background: #e2e8f0;
}

.structure-node.heading {
    font-weight: 600;
    color: #2d3748;
}

.structure-node.paragraph {
    padding-left: 1rem;
}

.structure-node.list {
    padding-left: 2rem;
}

/* Advanced Settings */
.advanced-settings {
    margin-top: 2rem;
}

.advanced-settings-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #667eea;
    font-weight: 500;
    margin-bottom: 1rem;
}

.advanced-settings-content {
    display: none;
}

.advanced-settings-content.show {
    display: block;
}

/* Find & Replace */
.find-replace-rules {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.find-replace-rule {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.find-replace-rule input {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.find-replace-rule button {
    padding: 0.5rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Quality Metrics */
.quality-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.metric-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.metric-label {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.25rem;
}