/* OCR - Leitura de números com câmera */
.ocr-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 25, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 1rem;
}

.ocr-modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 100%;
    width: 400px;
}

.ocr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ocr-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

#ocrContainer {
    min-height: 320px;
    position: relative;
    overflow: hidden;
}

.ocr-overlay-wrap {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: #000;
}

/* Quadro estilo Google Lens: branco, centralizado, cantos arredondados */
.ocr-frame {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 120px;
    min-width: 200px;
    min-height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5),
                inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 2;
    background: transparent;
}

.ocr-hint {
    max-width: 90%;
    white-space: normal;
    text-align: center;
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 13px;
    border-radius: 4px;
    z-index: 3;
}

.ocr-actions {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 3;
}

.btn-ocr-capture {
    padding: 0.5rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-ocr-capture:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-ocr-capture:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ocr-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    font-size: 1.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius);
}

/* Botão OCR na search box */
.btn-ocr {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(88, 166, 255, 0.2);
    border: 1px solid rgba(88, 166, 255, 0.4);
    border-radius: var(--radius);
    color: var(--accent);
    cursor: pointer;
}

.btn-ocr:hover {
    background: rgba(88, 166, 255, 0.3);
}

.btn-ocr-icon {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Botão microfone */
.btn-mic {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(63, 185, 80, 0.2);
    border: 1px solid rgba(63, 185, 80, 0.4);
    border-radius: var(--radius);
    color: var(--success);
    cursor: pointer;
}

.btn-mic:hover {
    background: rgba(63, 185, 80, 0.3);
}

.btn-mic.listening {
    background: rgba(245, 81, 73, 0.3);
    border-color: var(--error);
    color: var(--error);
    animation: pulse-mic 1s ease-in-out infinite;
}

@keyframes pulse-mic {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
