/* Publications specific */
.ocrdoe-pub-card {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
    padding: 0.625rem;
    border: 0.0625rem solid #e5e5e5;
    border-radius: 0.5rem;
    background: #fafafa;
}

.ocrdoe-pub-meta {
    font-size: 0.8125rem;
    color: #444;
}

.ocrdoe-thumb {
    border: 0.125rem solid #d2d2d2;
}

.ocrdoe-thumb.is-active {
    border: 0.125rem solid green;
}

/* Grid 2 colunas responsivo */
.ocr-grid {
    display: grid;
    grid-template-columns: 65% 35%;
    /* Maior espaço para a imagem */
    gap: 1rem;
    align-items: stretch;
    min-height: 75vh;
}

@media (max-width: 75rem) {
    .ocr-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 62rem) {
    .ocr-grid {
        grid-template-columns: 1fr;
        /* empilha no mobile */
        min-height: 80vh;
    }
}

/* Coluna da imagem: toolbar + área pan/zoom */
.ocr-col--img {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 75vh;
}

.ocr-toolbar {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.25rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border: 0.0625rem solid #e9ecef;
}

.ocr-btn {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 0.875rem;
    border-radius: 0.375rem;
    cursor: pointer;
    white-space: nowrap;
    border: 0.0625rem solid #198754;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.375rem;
}

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

.ocrdoe-btn--ok {
    margin-left: auto; /* Empurra o download para a direita no desktop */
}

@media (max-width: 48rem) {
    .ocr-toolbar {
        justify-content: center;
        gap: 0.25rem;
    }
    
    .ocr-btn {
        flex: 1 1 auto; /* Botões crescem para preencher a linha no mobile */
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }

    .ocrdoe-btn--ok {
        margin-left: 0;
        width: 100%; /* Download ocupa a linha toda no mobile para destaque */
        margin-top: 0.25rem;
    }
}

@media (max-width: 30rem) {
    .ocr-btn[title="100%"] {
        display: none; /* Esconde o botão 100% em telas minúsculas para caber o resto */
    }
}

/* Área de pan/zoom: evita "vazar" */
.ocr-panzoom {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f0f0f0;
    border: 0.0625rem solid #ddd;
    border-radius: 0.5rem;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

/* Imagem pan/zoom */
.ocr-img {
    transform-origin: center center; /* Mudado para facilitar centralização */
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

/* Coluna do texto */
.ocr-col--text {
    min-height: 60vh;
    max-height: 75vh; /* Impede que o texto estique o modal infinitamente */
    border: 0.0625rem solid #dee2e6;
    border-radius: 0.5rem;
    background: #ffffff;
    overflow-y: auto;
    box-shadow: inset 0 0.125rem 0.375rem rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.ocr-text {
    margin: 0;
    padding: 1.25rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "Courier New", Courier, monospace; /* Fonte mono para dados técnicos */
    font-size: 0.875rem;
    line-height: 1.6;
    color: #212529;
    background: linear-gradient(to bottom, #fff 0%, #fafafa 100%);
}

@media (max-width: 62rem) {
    .ocr-col--text {
        min-height: 40vh;
        max-height: 50vh; /* No mobile, o texto fica menor para priorizar a imagem */
    }
    
    .ocr-text {
        font-size: 0.8125rem;
        padding: 0.9375rem;
    }
}

.ocrdoe label {
    font: 0.875rem "OpenSans-Semibold", Helvetica, Arial, sans-serif;
    margin-bottom: 0;
}

.ocrdoe .gap-3 {
    gap: 1.5rem;
}

.ocrdoe .gap-3 {
    gap: 1.5rem;
}

.ocrdoe .form-group {
    margin-bottom: 0 !important;
}

.ocrdoe .card-deck {
    display: flex !important;
    flex-direction: column !important;
}

.ocrdoe-doc a:hover,
.ocrdoe-tab:hover {
    background: #055a26 !important;
    color: #FFF !important;
}

.ocrdoe-badge,
.ocrdoe-thumb__lbl,
.ocrdoe-modal .d-none {
    display: none !important;
}

.ocrdoe label {
    font: 0.875rem "OpenSans-Semibold", Helvetica, Arial, sans-serif;
    margin-bottom: 0;
}

.ocrdoe .gap-3 {
    gap: 1.5rem;
}

.ocrdoe .gap-3 {
    gap: 1.5rem;
}

.ocrdoe .form-group {
    margin-bottom: 0 !important;
}

.ocrdoe .card-deck {
    display: flex !important;
    flex-direction: column !important;
}

.ocrdoe-modal .ocr-text {
    font: 1.125rem "OpenSans-Semibold", Helvetica, Arial, sans-serif;
    font-family: serif;
}

.ocrdoe-modal .btn-success:hover {

    background: #055a26 !important;
    color: #FFF !important;
}
