@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

:root {
    --primary-color: #9333ea;
    --secondary-color: #7e22ce;
    --error-color: red;
    --font-family: 'Inter', sans-serif;
}

/* Lista de Alimentos */
.food-list {
    margin-top: 20px;
    width: 100%;
}

.food-item {
    background-color: #f8fafc;
    border-radius: 5px;
    padding: 14px;
    margin-bottom: 10px;
    border-radius: 8px; /* Rounded corners for a smoother look */
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #ddd;
    color: #333;
    transition: box-shadow 0.3s;
}

/* Estilos para as opções de ordenação */
.sort-options {
    margin-top: 20px;
    text-align: center;
}

.sort-options p {
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

.sort-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sort-buttons button {
    width: fit-content;
    padding: 10px 15px;
    background-color: #f8fafc;
    border: 1px solid #ddd;
    color: #333;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    transition: background-color 0.3s, color 0.3s;
}

.sort-buttons button:hover {
    background-color: #e2e8f0;
}

.sort-buttons button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.food-ranking {
    font-size: 14px;
    color: #555;
    margin: 5px 0;
}


.food-details {
    text-align: left;
    flex: 1;
}

.food-item h2 {
    margin: 0;
    font-size: 18px;
    color: #000000;
}

.food-item p {
    margin: 5px 0;
    color: #555;
    font-size: 14px;
}

.detail-button {
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
    margin-left: 10px;
    flex-shrink: 0;
}

.detail-button:hover {
    color: var(--secondary-color);
}


body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #fafafa;
}

.container {
    max-width: 520px;
    width: 100%;
    min-width: 350px;
    margin: 20px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background-color: #fff;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .container {
        margin: 0;
        padding: 20px;
        box-shadow: none;
        border-radius: 0;
        width: 100vw;
        min-height: 100vh;
    }
    body {
        background-color: white;
    }
}

.subtitle {
    color: #94a3b8;
    font-weight: normal;
}

.highlight {
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 12px;
}

select, input:not([type="radio"]) {
    width: 100%;
    padding: 10px;
    margin-bottom: 0px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
    appearance: none;
}

select {
    background: url('data:image/svg+xml;utf8,<svg fill="%23000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 10px center;
    background-size: 12px;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--secondary-color);
}

.radio-group {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}




.info {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 0px;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

th {
    background-color: #f8fafc;
}

td[style*="opacity: 0.4;"] {
    opacity: 0.4;
}

th[role="columnheader"] {
    cursor: pointer;
}

.error {
    border-color: var(--error-color);
}

.center {
    text-align: center;
}

@media (max-width: 400px) {
    table, th, td {
        font-size: 14px;
    }
    button {
        padding: 12px;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.4);
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 10px;
    overflow-y: auto;
    max-height: 80%;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.lupa {
    cursor: pointer;
    margin-right: 10px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.comparison-table th {
    background-color: #f8fafc;
}

.comparison-table caption {
    font-size: 0.8em;
    margin-top: 10px;
}

.na-value {
    opacity: 0.25;
}

.difference-positive {
    color: green;
}

.difference-negative {
    color: red;
}

.comparison-table-caption {
    margin-top: 15px;
    text-align: left;
    font-size: 0.8em;
}

.fit-content {
    width: 1%;
    white-space: nowrap;
}

.fill {
    width: auto;
}

#radio-group-label {
    display: none;
    font-weight: bold;
    margin-bottom: 5px;
}

.chevron {
    display: inline-block;
    margin-left: 5px;
}

.chevron-up::after {
    content: '⬆️';
}

.chevron-down::after {
    content: '⬇️';
}


/* ----------------------------------------------- */

/* General button styling */
button {
    padding: 13px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    width: 100%;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
    transition: background-color 0.3s, color 0.3s;
    margin-top: 4px;
}

button:hover {
    background-color: var(--secondary-color);
}

button:focus {
    outline: none;
}

/* Info button styling */
.info-button {
    margin-top: 8px;
    padding: 12px;
    background-color: #f8fafc;
    border: 1px solid #ddd;
    color: var(--primary-color);
    cursor: pointer;
    width: 100%;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
}



.info-button:hover {
    background-color: var(--primary-color);
    color: white;
}

.info-button:focus {
    outline: none;
}

/* Radio button styling */

.radio-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    margin: 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    background-color: #f9f9f9;
    font-size: 16px;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.radio-card input {
    display: none;
}

.radio-card label {
    width: 100%;
    text-align: center;
    margin-bottom: 0px;
    font-size: 16px;
}

#resultados {
    display: none;
}

#resultados-thead th {
    font-size: 14px; /* Altere para o tamanho desejado */
}


.radio-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

.radio-card:hover {
    background-color: #e9e9e9;
}



/* Video button styling */
.video-button-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    margin-bottom: 28px;
}

.video-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background-color: #f8fafc;
    border: 1px solid #ddd;
    color: var(--primary-color);
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    text-align: center;
}

.video-button:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.video-button:focus {
    outline: none;
}

.video-button .icon {
    font-size: 24px; /* Reduced font size for icon */
    color: var(--primary-color);
    margin-right: 8px; /* Reduced margin for better alignment */
    transition: color 0.3s;
}

.video-button .button-text {
    text-align: center;
    transition: color 0.3s;
}

.video-button .button-text strong,
.video-button .button-text span {
    color: var(--primary-color);
    display: block;
    font-size: 16px;
    transition: color 0.3s;
}

.video-button:hover .icon,
.video-button:hover .button-text strong,
.video-button:hover .button-text span {
    color: white;
}



/* ----------------------------------------------- */


.warning-message {
    color: #d9534f; /* Cor vermelha para chamar atenção */
    font-weight: bold;
    margin-top: 12px;
    text-align: left;
}

#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5); /* Fundo preto de baixa opacidade */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9980; /* Garantir que o loader fique sobreposto a todos os elementos */
}

.spinner {
   width: 11.2px;
   height: 11.2px;
   animation: spinner-z355kx 1s infinite linear;
   border-radius: 11.2px;
   box-shadow: 28px 0px 0 0 var(--primary-color), 17.4px 21.8px 0 0 var(--primary-color), -6.2px 27.2px 0 0 var(--primary-color), -25.2px 12px 0 0 var(--primary-color), -25.2px -12px 0 0 var(--primary-color), -6.2px -27.2px 0 0 var(--primary-color), 17.4px -21.8px 0 0 var(--primary-color);
}

@keyframes spinner-z355kx {
   to {
      transform: rotate(360deg);
   }
}

.aba {
    display: none;
}

.aba.ativa {
    display: block;
}

/* Adicionando estilo para a segunda aba */
#segunda-aba .title {
    text-align: center;
    color: var(--primary-color);
    margin-top: 12px;
    margin-bottom: 0px;
    font-weight: bold;
    font-size: 2em;
}

#segunda-aba .info {
    text-align: center;
    color: #000000; /* Ajustando a cor para combinar com a paleta */
    margin-top: 10px;
    margin-bottom: 24px;
    font-size: 1em;
    font-weight: normal;
}

#segunda-aba .info-button {
    margin-top: 16px; /* Ajustando o espaçamento para manter a consistência */
}

/* Estilo para o box informativo */
.info-box {
    display: block;
    padding: 14px;
    padding-top: 10px;
    padding-bottom: 10px;
    margin-top: 15px;
    font-size: 14px;
    background-color: #f8fafc;
    border: 1px solid #ddd;
    color: #333;
    text-align: left;
    border-radius: 8px; /* Rounded corners for a smoother look */
}

.info-box .header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Ensure chevron is at the end */
    cursor: pointer;
}

.info-box .icon {
    font-size: 24px;
    margin-right: 10px; /* Consistent spacing */
    color: #333; /* Ensure icon color matches text */
}

.info-box h6 {
    font-size: 14px;
    margin: 0;
    color: #333; /* Ensure text color matches icon */
    flex: 1; /* Take up remaining space */
}

.info-box .chevron {
    font-size: 24px;
    transition: transform 0.3s ease;
    color: #333; /* Ensure chevron color matches text */
}

.info-box .content {
    display: none;
    margin-top: 10px;
    margin-bottom: 0px;
    line-height: 1.5; /* Better readability */
}

.option-opacity {
    color: rgba(0, 0, 0, 0.5);
}



/* Estilização básica do contêiner do Tom Select */
.ts-control {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    padding: 10px;
    font-size: 16px;
    line-height: 1.5;
    color: #000; /* Cor do texto */
    background-color: #fff; /* Cor de fundo */
    border: 1px solid #ddd; /* Cor da borda */
    border-radius: 5px; /* Raio da borda */
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>'); /* Ícone de seta */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    white-space: nowrap; /* Evitar quebra de linha */
    overflow: hidden; /* Oculta texto que excede o tamanho do contêiner */
    text-overflow: ellipsis; /* Adiciona "..." ao final do texto se necessário */
    cursor: text;
}

/* Foco no contêiner Tom Select */
.ts-control:focus-within {
    border-color: var(--primary-color); /* Cor de borda ao focar */
    box-shadow: 0 0 0 3px var(--primary-color); /* Sombra ao focar */
}

/* Estilização do dropdown */
.ts-dropdown {
    border: 1px solid #ddd; /* Cor da borda do dropdown */
    border-radius: 5px; /* Raio da borda */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Sombra */
    background-color: white; /* Cor de fundo */
}

/* Estilização dos itens no dropdown */
.ts-option, .ts-option[data-selected], .ts-option:hover, .ts-option[data-highlighted], .ts-item {
    padding: 10px;
    font-size: 16px;
    background-color: #fff; /* Cor de fundo padrão para itens */
    white-space: nowrap; /* Evitar quebra de linha nos itens */
}

.ts-option[data-selected] {
    background-color: #eee; /* Cor de fundo do item selecionado */
}

.ts-option:hover, .ts-option[data-highlighted] {
    background-color: #f8fafc; /* Cor de fundo ao passar o mouse */
}

/* Estilização do item selecionado */
.ts-item {
    color: #000; /* Cor do texto */
    background-color: #e9e9e9; /* Cor de fundo */
}

/* Estilização do input de busca dentro do Tom Select */
.ts-control input, .ts-input input {
    flex: 1; /* Ocupar o espaço disponível */
    min-width: 0; /* Prevenir quebra de linha por largura mínima */
    border: none;
    outline: none;
    box-shadow: none;
    background: none; /* Remover qualquer fundo */
    color: inherit; /* Herdar a cor do texto */
    padding: 0; /* Remover padding interno */
    margin: 0; /* Remover margens */
}

/* Esconde qualquer botão de remoção dentro do Tom Select */
.ts-wrapper .ts-remove, .ts-wrapper.plugin-remove_button:not(.rtl) .item .remove {
    display: none; /* Forçar a remoção do botão */
}

/* Estilo adicional para manter os itens de seleção em linha */
.ts-wrapper .ts-control .item {
    display: flex; /* Usa flex para manter itens em linha */
    align-items: center; /* Centraliza itens verticalmente */
    margin-right: 5px; /* Margem para separação dos itens */
}


.ts-dropdown-content .option {
    color: #303030; /* Cor do texto */
    font-family: 'Inter', sans-serif; /* Mantendo a consistência com a família de fontes */
    font-size: 16px; /* Aumentando o tamanho da fonte para melhor legibilidade em dispositivos móveis */
    line-height: 24px; /* Aumentando a altura da linha para melhorar a legibilidade */
    visibility: visible;
    overflow: hidden; /* Esconde texto que excede o tamanho do contêiner */
    padding: 10px 12px; /* Aumento do padding para um toque mais fácil */
    opacity: 1;
    cursor: pointer; /* Garante que o cursor seja um ponteiro para indicar a capacidade de seleção */
    border-bottom: 1px solid #f0f0f0; /* Adiciona uma divisória sutil entre os itens */
    display: flex; /* Usando flex para alinhar itens corretamente */
    align-items: center; /* Centraliza os itens verticalmente */
}

/* Melhorias para telas pequenas */
@media (max-width: 768px) {
    .ts-dropdown-content .option {
        font-size: 18px; /* Tamanho maior para telas menores */
        padding: 12px 15px; /* Padding maior para facilitar a interação */
        line-height: 26px; /* Ajuste na altura da linha */
    }
}

/* Ajuste visual adicional para foco e hover */
.ts-dropdown-content .option:hover, .ts-dropdown-content .option:focus {
    background-color: #e6e6e6; /* Cor de fundo ao passar o mouse ou focar */
    color: #000; /* Cor do texto ao passar o mouse ou focar */
}

/* Ajuste para o item selecionado */
.ts-dropdown-content .option[data-selected] {
    background-color: #d6d6d6; /* Cor de fundo para o item selecionado */
    font-weight: bold; /* Deixa o texto em negrito para destacar o item selecionado */
}


/* Modal para o Tom Select */
#tom-select-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.4);
}

#tom-select-modal .modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 10px;
    position: relative;
}

#tom-select-modal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

#tom-select-modal .close:hover,
#tom-select-modal .close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
