/* =========================================================
   SCAN FOR MARC - CSS UNIFICADO (INDEX, SFM2 e OCR)
   ========================================================= */

/* 1. RESET E ESTILOS BASE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f4f6f9;
    color: #333333;
    line-height: 1.6;
}

/* 2. LAYOUT E CONTAINERS PRINCIPAIS */
#interface, .container {
    max-width: 1100px;
    margin: 20px auto;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

/* 3. CABEÇALHO PADRONIZADO (#cabecalho / header) */
#cabecalho, header {
    background-color: #ffffff;
    color: #ffffff;
    padding: 25px 20px;
    text-align: center;
}

#cabecalho h1, header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
    color: #4e4d52;
}

#cabecalho p, header p {
    font-size: 1rem;
    color: #cbd5e1;
}

#imagem1 {
    max-width: 100%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    margin-bottom: 10px;
}

/* 4. MENU DE NAVEGAÇÃO PADRONIZADO (#menu / nav / .navbar) */
#menu, nav, .navbar {
    background-color: #4e4d52;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    text-align: center;
}

#menu h1 {
    display: none;
}

#menu ul, nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

#menu a, nav a, .navbar a {
    display: inline-block;
    padding: 14px 24px;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.3s ease, color 0.3s ease;
}

#menu a:hover, #menu a.active,
nav a:hover, nav a.active,
.navbar a:hover, .navbar a.active {
    background-color: #7e7d81;
    color: #ffffff !important;
    text-decoration: none;
}

/* 5. CONTEÚDO E PÁGINAS (#corpo / .content) */
#corpo, .content {
    padding: 35px 40px;
}

#corpo p {
    margin-bottom: 18px;
    text-align: justify;
    font-size: 1.05rem;
    color: #4a5568;
}

.highlight {
    color: #2867a9;
    font-weight: 600;
}

/* 6. GRID E FORMULÁRIOS (SFM2 & OCR) */
.grid {
    display: flex;
    gap: 20px;
}

.col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

label {
    font-weight: 600;
    color: #2867a9;
    cursor: pointer;
}

label img {
    pointer-events: none;
}

textarea, .taclass {
    display: block;
    width: 100%;
    height: 340px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #1e293b;
    background-color: #ffffff;
    resize: vertical;
    box-sizing: border-box;
}

textarea:focus, .taclass:focus {
    outline: none;
    border-color: #1e4b7a;
    box-shadow: 0 0 0 3px rgba(30, 75, 122, 0.2);
}

/* Oculta apenas os inputs de arquivo/botões específicos ativados por <label> */
form input[type="file"],
form input[type="submit"].hidden-btn,
form input[type="button"].hidden-btn {
    display: none;
}

/* 7. CONTROLES, BOTÕES E OPÇÕES */
.controls {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.charset-group, .leftradio, .rightradio {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.charset-group label, .leftradio label, .rightradio label {
    font-weight: normal;
    color: #475569;
}

.btn, input[type="submit"], input[type="button"] {
    background-color: #1e4b7a;
    color: #ffffff;
    border: none;
    padding: 10px 22px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn:hover, input[type="submit"]:hover, input[type="button"]:hover {
    background-color: #2867a9;
}

.btn-clear, .leftclear a, .rightclear a {
    background-color: #e2e8f0;
    color: #475569;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-clear:hover, .leftclear a:hover, .rightclear a:hover {
    background-color: #cbd5e1;
    color: #2867a9;
    text-decoration: none;
}

/* 8. ELEMENTOS ESPECÍFICOS DO OCR */
.container-preview {
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #f8fafc;
}

#previewing {
    max-width: 100%;
    max-height: 300px;
    height: auto;
    object-fit: contain;
}

/* Setas de ação interativas */
.seta {
    font-size: 32px;
    color: #1e4b7a;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s, transform 0.2s;
}

.seta:hover {
    color: #38ef7d;
    transform: scale(1.15);
}

.seta2 {
    font-size: 36px;
    color: #1e4b7a;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s, transform 0.2s;
}

.seta2:hover {
    color: #38ef7d;
    transform: scale(1.15);
}

/* Mensagens de Feedback */
#success {
    color: #16a34a;
    font-weight: 600;
}

#invalid {
    color: #dc2626;
    font-weight: 600;
}

/* 9. RODAPÉ (footer) */
footer, .footer {
    text-align: center;
    padding: 20px;
    background-color: #e2e8f0;
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 20px;
}

/* 10. RESPONSIVIDADE (MOBILE) */
@media (max-width: 768px) {
    #menu ul, nav ul {
        flex-direction: column;
    }
    #menu a, nav a, .navbar a {
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 12px;
    }
    #corpo, .content {
        padding: 20px;
    }
    .grid {
        flex-direction: column;
    }
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    .btn {
        width: 100%;
    }
}
