/* Regra global para evitar overflow */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 20px;
    font-size: 16px;
    padding: 10px;
}

.section {
    margin-bottom: 1px;
}

/* Container geral da caixa de busca */
.search-box {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    margin-top: 20px;
    width: 99%;
    max-width: 600px;
}

/* Novo container para o input e os botões, para posicioná-los internamente */
.search-box .input-container {
    position: relative;
    width: 100%;
}

/* Estilo do input, com padding para acomodar os botões à esquerda e à direita */
.search-box .input-container input[type="text"] {
    width: 100%;
    padding: 10px 10px 10px 10px; /* espaço à esquerda e à direita */
    font-size: 1em;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Botão de pesquisa (search-btn): posicionado à esquerda, visível inicialmente */
.search-box .input-container button.search-btn {
    position: absolute;
    right: 10px;
    top: 55%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.25em;
    color: #6c757d;
    border: none;
    background: none;
    display: block;
}

/* Botão de limpar (clear-btn): posicionado à direita, oculto inicialmente */
.search-box .input-container button.clear-btn {
    position: absolute;
    right: 10px;
    top: 55%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.25em;
    color: #6c757d;
    border: none;
    background: none;
    display: none;
}

.search-box .input-container button.clear-btn.show {
    display: block;
}

/* Resto do CSS permanece inalterado */
.section-header {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 5px;
    border-bottom: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
}

.section-header .icon {
    padding: 0 4px;
    min-width: 10px;
    display: inline-flex;
    justify-content: center;
    align-items: left;
}

.section-header.open {
    border-left: 4px solid #FF9800;
}

/* Regras para cabeçalhos de capítulos e seções */
.title-header,
.book-header,
.chapter-header,
.subsection-header {
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    color: #343a40;
    margin: 15px 0 10px 0;
    padding: 5px 0;
    border-bottom: 1px solid #dee2e6;
}

.title-header {
    font-size: 1.0em;
    color: #2c3e50;
}

.book-header {
    font-size: 0.95em;
    color: #34495e;
}

.chapter-header {
    font-size: 0.9em;
    color: #495057;
}

.subsection-header {
    font-size: 0.85em;
    color: #6c757d;
}

.section .title {
    border-bottom: 1px solid #dee2e6;
    padding: 10px 0;
    font-size: 0.9em;
    color: #495057;
}

.article {
    border-bottom: 1px solid #dee2e6;
    padding: 10px 0;
    font-size: 0.9em;
    color: #495057;
}

.article-title {
    background-color: #f5f5f5;
    padding: 12px 15px;
    border-left: 3px solid #6c757d;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 8px;
    border-radius: 0;
}

.article-title .icon {
    margin-right: 12px;
    color: #495057;
    font-size: 1em;
    font-weight: bold;
}

.article-title.open {
    border-left: 3px solid #495057;
    background-color: #f5f5f5;
    font-weight: 600;
}


.article-summary {
    flex-grow: 1;
    font-size: 0.95em;
    padding-left: 0;
    color: #495057;
    font-weight: 400;
}

.paragraph {
    padding-left: 5px;
    font-size: 0.95em;
    color: #495057;
}

.item,
.paragraph-item {
    padding-left: 5px;
    font-size: 0.95em;
    color: #495057;
}

.alinea {
    padding-left: 10px;
    font-size: 0.95em;
    color: #495057;
}

.collapsible {
    cursor: pointer;
    user-select: none;
}

.collapsible:hover {
    text-decoration: none;
}

.title-definition {
    border-bottom: 1px solid #dee2e6;
    padding: 10px 0;
    font-size: 1em;
    color: #495057;
    text-align: justify;
}

.item-note,
.definitions,
.observation {
    border: 1px solid #e9ecef;
    background-color: #f8f9fa;
    padding: 8px;
    line-height: 1.5;
    font-size: 0.92em;
    color: #495057;
    border-radius: 4px;
    margin-bottom: 5px;
}

.item-details,
.article-details,
.paragraph-details {
    border: 1px solid #e9ecef;
    background-color: #f8f9fa;
    padding: 8px;
    line-height: 1.5;
    font-size: 0.87em;
    color: #495057;
    border-radius: 4px;
    margin-bottom: 2px;
}

.options-list {
    list-style: none;
    padding-left: 20px;
    margin: 8px 0;
}

.options-list .option {
    font-size: 0.85em;
    color: #495057;
    line-height: 1.4;
    margin-bottom: 4px;
    padding-left: 5px;
}

.options-list .option strong {
    color: #343a40;
}

.content {
    display: none;
    overflow: hidden;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #fff;
    border: 0px solid #ddd;
}

.active .content {
    display: block;
}

.highlightText {
    border: 1px solid #FFB74D;
    background-color: #FFCC80;
    padding: 0 2px;
}

.expand-link {
    display: inline-block;
    margin-top: 5px;
    font-size: 0.80em;
    text-decoration: none;
    text-align: right;
    color: #343a40;
    width: 100%;
}

/* ===== Media Queries para Tablets e Celulares ===== */
@media (max-width: 768px) {
    body {
        margin: 10px;
        font-size: 15px;
    }
    .search-box {
        max-width: 100%;
    }
    .search-box .input-container input[type="text"] {
        width: 100%;
        padding: 10px 35px 10px 35px;
        font-size: 1em;
    }
    .search-box .input-container button.search-btn,
    .search-box .input-container button.clear-btn {
        font-size: 1.1em;
        top: 50%;
    }
}

@media (max-width: 480px) {
    body {
        margin: 5px;
        font-size: 15px;
    }
    .search-box .input-container input[type="text"] {
        padding: 10px 30px 10px 30px;
    }
    .search-box .input-container button.search-btn,
    .search-box .input-container button.clear-btn {
        font-size: 1em;
    }
}
