/* ============================================================================
   IMAGE TO TEXT (OCR) TOOL — All-WebTools
   ============================================================================ */

/* Settings Bar */
.itt-settings-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.itt-setting-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.itt-setting-group > label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.itt-select {
    padding: 0.45rem 2rem 0.45rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    transition: border-color 0.2s;
}

.itt-select:focus {
    outline: none;
    border-color: #ff8c00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

/* Toggle Switch */
.itt-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.itt-toggle-label input[type="checkbox"] {
    display: none;
}

.itt-toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #d1d5db;
    border-radius: 10px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.itt-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.itt-toggle-label input:checked + .itt-toggle-switch {
    background: #ff8c00;
}

.itt-toggle-label input:checked + .itt-toggle-switch::after {
    transform: translateX(16px);
}

/* Converter Grid */
.itt-converter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    position: relative;
}

/* Panels */
.itt-panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.itt-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    min-height: 52px;
}

.itt-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.itt-panel-title iconify-icon {
    color: #ff8c00;
    font-size: 18px;
}

.itt-btn-small {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    font-size: 12px;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.itt-btn-small:hover {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}

/* Drop Zone */
.itt-drop-zone {
    position: relative;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
}

.itt-drop-zone.dragover {
    background: #fff7ed;
}

.itt-drop-zone.dragover .itt-drop-content {
    border-color: #ff8c00;
}

.itt-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    margin: 1.25rem;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    width: calc(100% - 2.5rem);
    transition: border-color 0.3s;
}

.itt-drop-content:hover {
    border-color: #ff8c00;
}

.itt-drop-icon {
    font-size: 48px;
    color: #d1d5db;
    line-height: 1;
}

.itt-drop-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.itt-drop-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

.itt-drop-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.itt-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    font-size: 13px;
    font-weight: 600;
    color: white;
    background: #ff8c00;
    border: 2px solid #ff8c00;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.itt-upload-btn:hover {
    background: #e67e00;
    border-color: #e67e00;
}

.itt-upload-btn-outline {
    color: #374151;
    background: white;
    border-color: #d1d5db;
}

.itt-upload-btn-outline:hover {
    color: #ff8c00;
    border-color: #ff8c00;
    background: #fff7ed;
}

/* Image Preview */
.itt-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: auto;
}

.itt-preview img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Process Button */
.itt-process-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 15px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #ff8c00, #e67e00);
    border: none;
    border-radius: 0 0 16px 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.itt-process-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e67e00, #cc7000);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}

.itt-process-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    color: #9ca3af;
}

/* Output Panel */
.itt-output-body {
    flex: 1;
    padding: 0;
    min-height: 340px;
    display: flex;
}

.itt-textarea {
    width: 100%;
    height: 100%;
    min-height: 340px;
    padding: 1.25rem;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: #1f2937;
    background: #fafafa;
    border: none;
    resize: none;
    outline: none;
}

.itt-textarea::placeholder {
    color: #9ca3af;
    font-family: inherit;
}

/* Stats */
.itt-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.itt-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 20px;
}

.itt-stat-chip iconify-icon {
    font-size: 12px;
}

.itt-confidence {
    color: #16a34a;
    background: #dcfce7;
}

.itt-confidence.low {
    color: #dc2626;
    background: #fef2f2;
}

.itt-confidence.medium {
    color: #d97706;
    background: #fef3c7;
}

/* Panel Footer / Actions */
.itt-panel-footer {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

.itt-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.itt-action-btn:hover {
    color: #ff8c00;
    border-color: #ff8c00;
    background: #fff7ed;
}

.itt-action-btn.copied {
    color: #16a34a;
    border-color: #bbf7d0;
    background: #dcfce7;
}

/* Progress Overlay */
.itt-progress-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.itt-progress-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.itt-progress-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top-color: #ff8c00;
    border-radius: 50%;
    margin: 0 auto 1.25rem;
    animation: itt-spin 0.8s linear infinite;
}

@keyframes itt-spin {
    to { transform: rotate(360deg); }
}

.itt-spin {
    animation: itt-spin 1s linear infinite;
    display: inline-block;
}

.itt-progress-status {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 1.25rem;
}

.itt-progress-bar-track {
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.itt-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff8c00, #f59e0b);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.itt-progress-percent {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin: 0;
}

/* Toast */
.itt-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.itt-toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #1f2937;
    color: white;
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: itt-toast-in 0.3s ease;
}

.itt-toast.success { background: #16a34a; }
.itt-toast.error { background: #dc2626; }

@keyframes itt-toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Info Grid */
.itt-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.itt-info-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.itt-info-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 0.75rem;
}

.itt-info-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.4rem;
}

.itt-info-card p {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* SEO Content */
.itt-seo-content {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    margin-top: 3rem;
}

.itt-seo-main h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 2rem 0 1rem;
}

.itt-seo-main h2:first-child {
    margin-top: 0;
}

.itt-seo-main p,
.itt-seo-main li {
    font-size: 15px;
    line-height: 1.7;
    color: #4b5563;
}

.itt-seo-main ol,
.itt-seo-main ul {
    padding-left: 1.25rem;
    margin: 0.75rem 0;
}

.itt-seo-main li {
    margin-bottom: 0.5rem;
}

/* Related Tools Sidebar */
.itt-seo-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.itt-related-tools {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    position: sticky;
    top: 6rem;
}

.itt-related-tools h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ff8c00;
}

.itt-related-tools ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.itt-related-tools li {
    margin-bottom: 0.25rem;
}

.itt-related-tools a {
    display: block;
    padding: 0.45rem 0.6rem;
    font-size: 13px;
    color: #4b5563;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}

.itt-related-tools a:hover {
    color: #ff8c00;
    background: #fff7ed;
}

/* FAQ */
.itt-faq-section {
    margin-top: 1rem;
}

.itt-faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.itt-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    background: white;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.itt-faq-question::after {
    content: '+';
    font-size: 18px;
    font-weight: 400;
    color: #9ca3af;
    transition: transform 0.2s;
}

.itt-faq-item.active .itt-faq-question::after {
    content: '−';
    color: #ff8c00;
}

.itt-faq-question:hover {
    background: #fafafa;
}

.itt-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.itt-faq-item.active .itt-faq-answer {
    max-height: 500px;
}

.itt-faq-answer p {
    padding: 0 1.25rem 1rem;
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 1023px) {
    .itt-converter-grid {
        grid-template-columns: 1fr;
    }

    .itt-seo-content {
        grid-template-columns: 1fr;
    }

    .itt-related-tools {
        position: static;
    }
}

@media (max-width: 767px) {
    .itt-settings-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .itt-info-grid {
        grid-template-columns: 1fr;
    }

    .itt-drop-zone {
        min-height: 280px;
    }

    .itt-textarea {
        min-height: 250px;
    }

    .itt-drop-actions {
        flex-direction: column;
        width: 100%;
    }

    .itt-upload-btn {
        width: 100%;
        justify-content: center;
    }

    .itt-panel-footer {
        flex-wrap: wrap;
    }

    .itt-camera-btn {
        display: inline-flex;
    }
}

/* Hide camera button on desktop */
@media (min-width: 768px) {
    .itt-camera-btn {
        display: none;
    }
}
