/* Image OCR - Specific Styles */

/* OCR Settings */
.ocr-settings {
    background: var(--surface);
    border: 1px solid #1f2937;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

.ocr-settings h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 24px 0;
    color: var(--text);
    border-bottom: 1px solid #1f2937;
    padding-bottom: 12px;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.setting-select,
.setting-input {
    padding: 10px 12px;
    border: 1px solid #1f2937;
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.setting-select:focus,
.setting-input:focus {
    outline: none;
    border-color: var(--accent2);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 0;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent2);
    cursor: pointer;
}

.checkbox-item span {
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
}

/* Enhanced Progress Container */
.progress-container {
    background: var(--surface);
    border: 1px solid #1f2937;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    display: none;
}

.progress-container.show {
    display: block;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-text {
    color: var(--text);
    font-weight: 600;
}

.progress-percentage {
    color: var(--accent2);
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #1f2937;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent1), var(--accent2));
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Progress Details */
.progress-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.progress-stage,
.progress-confidence {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}

.progress-stage {
    color: var(--text);
    font-weight: 600;
}

.progress-confidence {
    color: var(--accent2);
    font-weight: 600;
}

/* Results Area */
.results-area {
    background: var(--surface);
    border: 1px solid #1f2937;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    display: none;
}

.results-area.show {
    display: block;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #1f2937;
}

.results-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.download-all {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

.download-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.35);
}

/* Text Results */
.text-result {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.text-result:hover {
    border-color: rgba(6, 182, 212, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.text-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.text-result-info {
    flex: 1;
}

.text-result-name {
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px 0;
    font-size: 1.1rem;
}

.text-result-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text);
    opacity: 0.7;
}

.text-result-actions {
    display: flex;
    gap: 8px;
}

.text-result-content {
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.text-result-content::-webkit-scrollbar {
    width: 6px;
}

.text-result-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.text-result-content::-webkit-scrollbar-thumb {
    background: var(--accent2);
    border-radius: 3px;
}

.text-result-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent1);
}

/* Confidence Indicator */
.confidence-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.confidence-high {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.confidence-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.confidence-low {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Language Badge */
.language-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent1);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.language-badge i {
    font-size: 0.7rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .settings-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .progress-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .ocr-settings {
        padding: 20px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .text-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .text-result-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .text-result-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .ocr-settings {
        padding: 16px;
    }
    
    .text-result {
        padding: 16px;
    }
    
    .text-result-content {
        max-height: 200px;
        font-size: 0.85rem;
        padding: 12px;
    }
    
    .progress-container {
        padding: 16px;
    }
}

/* Animation Classes */
.text-result {
    animation: slideInUp 0.4s ease-out;
}

.text-result:nth-child(1) { animation-delay: 0.1s; }
.text-result:nth-child(2) { animation-delay: 0.2s; }
.text-result:nth-child(3) { animation-delay: 0.3s; }
.text-result:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effects */
.text-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}

.checkbox-item:hover span {
    color: var(--accent2);
}

/* Focus States */
.checkbox-item input[type="checkbox"]:focus + span {
    color: var(--accent2);
}

/* Loading States */
.text-result.loading {
    opacity: 0.6;
    pointer-events: none;
}

.text-result.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent2);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success States */
.text-result.success {
    border-color: #22c55e;
}

.text-result.success .text-result-header {
    border-color: rgba(34, 197, 94, 0.2);
}

/* Error States */
.text-result.error {
    border-color: #ef4444;
}

.text-result.error .text-result-header {
    border-color: rgba(239, 68, 68, 0.2);
}

/* Text Highlighting */
.text-result-content .highlight {
    background: rgba(6, 182, 212, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
    color: var(--accent2);
}

/* Copy Button */
.copy-text-btn {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent2);
    border: 1px solid rgba(6, 182, 212, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-text-btn:hover {
    background: rgba(6, 182, 212, 0.2);
    transform: translateY(-1px);
}

.copy-text-btn.copied {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.2);
}

/* Download Button */
.download-text-btn {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.download-text-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}
