/* Estilos para a tela de login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f2f2f2;
}

.login-form {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 300px;
    text-align: center;
}

.login-form h2 {
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.login-form button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.login-form button:hover {
    background-color: #0056b3;
}

/* Estilos existentes */
body {
    font-family: Arial, sans-serif;
    text-align: center;
    margin: 0;
    padding: 20px;
    background-color: #f8f9fa;
}

/* Fix para tabelas não estourarem a tela */
table {
    table-layout: fixed;
    width: 100%;
    word-break: break-word;
    border-collapse: collapse;
    /* Garante que as bordas funcionem bem */
}

/* Bordas e Espaçamento */
tr {
    border-bottom: 1px solid #ccc;
    /* Linha dividindo registros */
}

td,
th {
    padding: 12px 8px;
    /* Mais espaço interno */
    overflow-wrap: break-word;
    vertical-align: middle;
    /* Centraliza verticalmente */
}

/* Ajuste de Colunas - TABELA DE PESOS (3 Colunas) */
#abaPesos table th:nth-child(1),
#abaPesos table td:nth-child(1) {
    width: 60%;
    text-align: left;
}

#abaPesos table th:nth-child(2),
#abaPesos table td:nth-child(2) {
    width: 20%;
    text-align: center;
}

#abaPesos table th:nth-child(3),
#abaPesos table td:nth-child(3) {
    width: 20%;
    text-align: center;
}

/* Ajuste de Colunas - TABELA DE EXERCÍCIOS (3 Colunas agora) */
#abaExercicios table th:nth-child(1),
#abaExercicios table td:nth-child(1) {
    width: 40%;
    text-align: left;
}

/* Nome */
#abaExercicios table th:nth-child(2),
#abaExercicios table td:nth-child(2) {
    width: 50%;
    text-align: left;
}

/* Link */
#abaExercicios table th:nth-child(3),
#abaExercicios table td:nth-child(3) {
    width: 10%;
    text-align: center;
}

/* Ações */



h1,
h2 {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

#topico-atual {
    font-size: 16px;
    margin: 10px 0;
}

.negrito {
    font-weight: bold;
}

.verde {
    color: green;
}

.button {
    display: inline-flex;
    /* Melhor alinhamento vertical */
    align-items: center;
    justify-content: center;
    margin: 2px;
    /* Reduzi margem para caber melhor */
    padding: 6px 12px;
    /* Reduzi um pouco padding */
    font-size: 13px;
    /* Texto um tico menor para garantir */
    white-space: nowrap;
    /* CRUCIAL: Impede quebra de texto */
    border: none;
    cursor: pointer;
    border-radius: 4px;
    /* Mais moderno */
    text-align: center;
    min-width: 60px;
    /* Garante tamanho mínimo clickável */

    background-color: green;
    /* Fallback default */
    color: white;
}

.button.blue {
    background-color: #007bff;
}

.button.blue:hover {
    background-color: #0069d9;
}

.button.red {
    background-color: #dc3545;
}

.button.red:hover {
    background-color: #c82333;
}

.button.add-button {
    background-color: #28a745;
}

.button.add-button:hover {
    background-color: #218838;
}

.button:disabled {
    background-color: #d3d3d3;
    cursor: not-allowed;
}

.link {
    margin-top: 20px;
    display: inline-block;
    color: purple;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

/* Estilos do Modal */
#modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 1000;
    width: 80%;
    max-width: 500px;
    max-height: 70%;
    overflow: hidden;
}

#modal h2 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
}

#modal ul {
    list-style: none;
    /* Remove marcadores */
    padding: 0;
    margin: 0;
    flex-grow: 1;
    /* Expande para ocupar o espaço restante */
    max-height: calc(70vh - 100px);
    /* Limita a altura da lista */
    overflow-y: auto;
    /* Ativa a rolagem vertical */
    border: 1px solid #ddd;
    /* Borda ao redor da lista */
    border-radius: 5px;
    padding: 10px;
    background-color: #f9f9f9;
    /* Fundo claro */
}

#modal ul li {
    margin: 5px 0;
    padding: 5px;
    cursor: pointer;
    background-color: transparent;
    /* Remove fundos adicionais */
    border: none;
    /* Remove bordas adicionais */
}

#modal ul li:hover {
    background-color: #eaeaea;
    /* Cor ao passar o mouse */
}

#modal button {
    margin-top: 10px;
    align-self: center;
    /* Centraliza o botão */
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
}

#modal button:hover {
    background-color: #0056b3;
}

#modal-overlay {
    display: none;
    /* Escondido por padrão */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Fundo escuro */
    z-index: 999;
}

.tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background-color: #dee2e6;
    cursor: pointer;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.tab-button.active {
    background-color: #007bff;
    color: white;
}

.aba-conteudo {
    padding: 10px 20px;
}



body.modal-open {
    overflow: hidden;
    /* Desativa o scroll da página de fundo */
}

.mensagem {
    padding: 10px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    font-size: 16px;
    color: white;
    text-align: center;
    animation: fadeIn 0.5s;
}

.mensagem.success {
    background-color: #28a745;
    /* Verde para sucesso */
}

.mensagem.error {
    background-color: #dc3545;
    /* Vermelho para erro */
}

#debug-panel {
    display: none;
}


@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Árvore hierárquica na lista do modal */
.topico-nivel-0 {
    font-weight: bold;
    cursor: default;
    color: #000;
}

.topico-nivel-1 {
    padding-left: 15px;
}

.topico-nivel-2 {
    padding-left: 30px;
}

.topico-nivel-3 {
    padding-left: 45px;
}

.topico-nivel-4 {
    padding-left: 60px;
}

/* Bloqueia clique nos pais */
.topico-pai {
    pointer-events: none;
    opacity: 0.6;
}

/* Tree Select Styles */
.tree-select-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin-bottom: 10px;
    font-family: Arial, sans-serif;
}

.tree-select-trigger {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-select-trigger:after {
    content: '▼';
    float: right;
    font-size: 12px;
    color: #666;
}

.tree-select-content {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-top: none;
    background-color: white;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tree-node {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-item-container {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    cursor: pointer;
}

.tree-item-container:hover {
    background-color: #f0f8ff;
    /* AliceBlue */
}

.tree-item-container.selected {
    background-color: #007bff;
    color: white;
}

.tree-toggle {
    margin-right: 5px;
    width: 16px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    color: #666;
}

.tree-toggle:hover {
    color: #000;
}

.tree-label {
    flex-grow: 1;
}

.tree-children {
    padding-left: 20px;
    /* Indentação */
    border-left: 1px dashed #eee;
    margin-left: 10px;
    display: none;
    /* Recolhido por padrão */
}

.tree-children.expanded {
    display: block;
}