/* style.css */

body {
    font-family: 'Inter', sans-serif;
    overscroll-behavior: none;
    margin: 0;
    background-color: #f3f4f6; /* bg-gray-100 */
    min-height: 100vh; /* min-h-screen */
    scroll-behavior: smooth; /* scroll-smooth */
}

/* Container de tabelas */
.table-container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem; /* mb-6 */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* shadow-md */
    border-radius: 0.5rem; /* rounded-lg */
}

/* Estilos de tabela */
table {
    min-width: 100%;
    table-layout: auto;
    border-collapse: collapse; /* border-collapse */
    background-color: #fff; /* bg-white */
}

th, td {
    min-width: 80px;
    white-space: nowrap;
    padding: 0.5rem; /* p-2 */
}

th {
    text-align: left;
    font-size: 0.875rem; /* text-sm */
    background-color: #e5e7eb; /* bg-gray-200 */
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Estilos de input */
input {
    width: 100%;
    min-width: 60px;
    padding: 0.25rem; /* p-1 */
    font-size: 0.875rem; /* text-sm */
    border: 1px solid #d1d5db; /* border border */
    border-radius: 0.25rem; /* rounded */
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    outline: none;
    border-color: transparent;
    --tw-ring-color: #3b82f6;
    --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
    --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
    box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

/* Contêiner do gráfico */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 900px; /* Limita a largura para melhor visualização */
    height: 500px;
    margin: 1.5rem auto; /* Centraliza o gráfico horizontalmente */
    display: block; /* Garante que 'margin: auto' funcione */
}

/* Estilos da barra lateral (sidebar) */
.sidebar {
    transition: transform 0.3s ease-in-out;
    position: fixed; /* fixed */
    top: 0; /* top-0 */
    left: 0; /* left-0 */
    height: 100vh; /* h-screen */
    width: 16rem; /* w-64 */
    background-color: #1f2937; /* bg-gray-800 */
    color: #fff; /* text-white */
    padding: 1rem; /* p-4 */
    display: flex;
    flex-direction: column; /* flex flex-col */
}

/* Título da barra lateral */
.sidebar h2 {
    font-size: 1.25rem; /* text-xl */
    font-weight: bold; /* font-bold */
    margin-bottom: 1rem; /* mb-4 */
}

/* Espaçamento dentro da barra lateral */
.sidebar-content-area {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* flex-grow */
    row-gap: 1.5rem; /* space-y-6 */
}

.sidebar-section-title {
    font-size: 0.875rem; /* text-sm */
    font-weight: 600; /* font-semibold */
    color: #9ca3af; /* text-gray-400 */
    margin-bottom: 0.5rem; /* mb-2 */
    text-transform: uppercase; /* uppercase */
    letter-spacing: 0.05em; /* tracking-wider */
}

.sidebar-nav-links,
.sidebar-action-buttons {
    display: flex;
    flex-direction: column;
    row-gap: 0.5rem; /* space-y-2 */
}

/* Estilos de botão base para sidebar */
.btn-sidebar-base {
    width: 100%;
    color: #fff;
    padding: 0.5rem 0.75rem; /* px-3 py-2 */
    border-radius: 0.25rem; /* rounded */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem; /* text-sm */
    transition: background-color 0.2s ease-in-out;
}

/* Cores específicas para botões de navegação da sidebar */
.btn-nav-active {
    background-color: #2563eb; /* bg-blue-700 */
}

.btn-nav-inactive {
    background-color: #4b5563; /* bg-gray-600 */
}

.btn-nav-inactive:hover {
    background-color: #374151; /* hover:bg-gray-700 */
}

/* Cores para botões de ação da sidebar */
.btn-add-row {
    background-color: #22c55e; /* bg-blue-600 (ajustado para verde) */
}
.btn-add-row:hover {
    background-color: #16a34a; /* hover:bg-blue-700 (ajustado para verde escuro) */
}

.btn-load-example {
    background-color: #9333ea; /* bg-purple-600 */
}
.btn-load-example:hover {
    background-color: #7e22ce; /* hover:bg-purple-700 */
}

.btn-analyze {
    background-color: #10b981; /* bg-green-600 (ajustado para teal) */
}
.btn-analyze:hover {
    background-color: #059669; /* hover:bg-green-700 (ajustado para teal escuro) */
}

.btn-generate-report {
    background-color: #ef4444; /* bg-red-600 */
}
.btn-generate-report:hover {
    background-color: #dc2626; /* hover:bg-red-700 */
}

/* Seletor de idioma */
.lang-selector-container {
    margin-top: 1.5rem; /* Ajustado para ficar abaixo das ações */
}
.lang-selector-container label {
    font-size: 0.875rem; /* text-sm */
    font-weight: 600; /* font-semibold */
    color: #9ca3af; /* text-gray-400 */
}
.lang-selector {
    width: 100%;
    background-color: #2e353f; /* Fundo do select: mais escuro, semelhante à imagem */
    border: 1px solid #4b5563; /* Borda do select*/
    border-radius: 0.25rem; /* Cantos arredondados*/
    margin-top: 0.25rem; /* Espaçamento superior */
    padding: 0.25rem 0.5rem; /* Preenchimento*/
    font-size: 0.875rem; /* Tamanho da fonte*/
    color: #fff; /* Cor do texto padrão*/
    appearance: none; /* Remove a aparência nativa do sistema */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%23ffffff' class='w-6 h-6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'%3E%3C/path%3E%3C/svg%3E"); /* Ícone de seta personalizado */
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25rem; /* Tamanho do ícone */
    cursor: pointer;
}

.lang-selector option {
    background-color: #2e353f; /* Fundo das opções: mais escuro, semelhante à imagem */
    color: #fff; /* Cor do texto das opções*/
    padding: 0.5rem; /* Adiciona padding para as opções */
}

/* Estilo para a opção selecionada no dropdown (não quando o select está fechado) */
.lang-selector option:checked {
    background-color: #3b82f6; /* Azul vibrante para a opção selecionada */
    color: #fff; /* Texto branco na opção selecionada */
}
/* Estilo para a opção em hover */
.lang-selector option:hover {
    background-color: #3b82f6; /* Cor de fundo azul no hover */
    color: #fff; /* Cor do texto branco no hover */
}
/* Estilo para o select quando em foco (aberto) */
.lang-selector:focus {
    border-color: #3b82f6;
    outline: 2px solid #3b82f6; /* Adiciona um anel de foco */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}


/* Navegação interna da seção de informações */
#info-nav-container {
    margin-top: auto; /* Volta para o final, para a navegação do artigo */
}
#info-nav-container h3 {
    font-size: 0.875rem; /* text-sm */
    font-weight: 600; /* font-semibold */
    color: #9ca3af; /* text-gray-400 */
    margin-bottom: 0.5rem; /* mb-2 */
    text-transform: uppercase; /* uppercase */
    letter-spacing: 0.05em; /* tracking-wider */
}
#info-nav {
    display: flex;
    flex-direction: column;
    row-gap: 0.25rem; /* space-y-1 */
    font-size: 0.875rem; /* text-sm */
}
#info-nav a {
    display: block;
    padding: 0.5rem; /* p-2 */
    border-radius: 0.25rem; /* rounded */
    color: #fff; /* cor padrão para links na sidebar */
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}
#info-nav a:hover {
    background-color: #4b5563; /* hover:bg-gray-700 */
}


/* Overlay de conteúdo para mobile */
#content-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 49;
}

/* Conteúdo principal */
#main-content {
    transition: margin-left 0.3s ease-in-out; /* transition-all duration-300 */
}

/* Barra de navegação superior (somente mobile) */
#top-nav-bar {
    background-color: #1f2937; /* bg-gray-800 */
    color: #fff; /* text-white */
    padding: 0.5rem; /* p-2 */
    display: flex;
    justify-content: space-between; /* justify-between */
    align-items: center; /* items-center */
    position: sticky;
    top: 0;
    z-index: 30;
}
#top-nav-bar h2 {
    font-size: 1.125rem; /* text-lg */
    font-weight: bold; /* font-bold */
}
#top-nav-bar button {
    color: #fff; /* text-white */
    outline: none; /* focus:outline-none */
}
#top-nav-bar button .fas { /* Ícones Font Awesome para mobile menu */
    font-size: 1.5rem; /* w-6 h-6 */
}


/* Estilos para tabela responsiva */
@media screen and (max-width: 768px) {
    .responsive-table thead {
        display: none;
    }
    .responsive-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.375rem;
        padding: 1rem;
        background-color: #fff;
    }
    .responsive-table td {
        display: block;
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    .responsive-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0.5rem;
        width: 45%;
        padding-right: 1rem;
        font-weight: 600;
        text-align: left;
        white-space: nowrap;
    }
    .responsive-table td input {
        text-align: right;
    }
    .responsive-table td.action-cell {
        padding: 0.5rem 0 0 0;
        text-align: center;
    }
    .responsive-table td.action-cell:before {
        content: '';
    }
}

/* Área de análise */
#analysis-area .main-title {
    font-size: 2rem; /* text-2xl */
    font-weight: bold; /* font-bold */
    color: #1f2937; /* text-gray-800 */
    margin-bottom: 1rem; /* mb-4 */
}
#analysis-area .main-description {
    color: #4b5563; /* text-gray-600 */
    margin-bottom: 1rem; /* mb-4 */
    font-size: 1rem; /* text-base */
}
/* Margem do conteúdo na análise - Alinhado com o prose */
.main-padding {
    padding: 1rem; /* Padding padrão para telas menores */
    max-width: 80rem; /* max-w-7xl */
    margin-left: auto; /* mx-auto */
    margin-right: auto; /* mx-auto */
}


/* Contêiner dos cards de resultado */
.results-grid {
    display: grid;
    gap: 1rem; /* gap-4 */
    grid-template-columns: repeat(2, 1fr); /* grid-cols-auto-fit */
    margin-top: 1.5rem; /* mt-6 */
}

/* Estilos para cada card de resultado */
.result-card {
    background-color: #ffffff;
    border-radius: 0.5rem; /* rounded-lg */
    padding: 1rem; /* p-4 */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); /* shadow-sm */
    border-left: 4px solid; /* Borda esquerda para cor de destaque */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.result-card-icon {
    font-size: 1.5rem; /* w-6 h-6, para Font Awesome */
    margin-bottom: 0.5rem; /* mb-2 */
    color: #3b82f6; /* Cor padrão para ícones nos cards */
}

/* Cores específicas para os ícones baseadas na borda */
.result-card.d-value .result-card-icon { color: #2563eb; }
.result-card.cu-value .result-card-icon { color: #f59e0b; }
.result-card.cc-value .result-card-icon { color: #10b981; }
.result-card.total-mass-value .result-card-icon { color: #6366f1; }


.result-card-label {
    font-size: 0.875rem; /* text-sm */
    color: #4b5563; /* text-gray-600 */
    font-weight: 500; /* font-medium */
    display: block; /* Garante que o rótulo ocupe sua própria linha */
    white-space: normal; /* Permite que o texto quebre linha se for muito longo */
    line-height: 1.2; /* Ajusta a altura da linha para melhor espaçamento */
}

.result-card-value {
    font-size: 1.25rem; /* text-xl */
    font-weight: bold; /* font-bold */
    color: #1f2937; /* text-gray-800 */
    margin-top: 0.25rem; /* Ajusta a margem para separar do label */
    display: block; /* Garante que o valor ocupe sua própria linha */
    white-space: normal; /* Permite que o texto quebre linha */
    line-height: 1.2; /* Ajusta a altura da linha */
}


/* Estilos para a área de informações (prose) */
.prose {
    max-width: 80rem; /* max-w-7xl */
    margin-left: auto; /* mx-auto */
    margin-right: auto; /* mx-auto */
    display: flex;
    flex-direction: column;
    row-gap: 4rem; /* space-y-16 */
    color: #374151; /* cor base para texto */
}

.prose h1, .prose h2, .prose h3 {
    margin-bottom: 0;
    color: #111827; /* text-gray-900 / text-gray-800 */
}
.prose h1 {
    font-size: 2.25rem; /* text-4xl */
    font-weight: 800; /* font-extrabold */
    letter-spacing: -0.025em; /* tracking-tight */
}
.prose h2 {
    font-size: 1.875rem; /* text-3xl */
    font-weight: 700; /* font-bold */
    letter-spacing: -0.025em; /* tracking-tight */
}
.prose h3 {
    font-size: 1.25rem; /* text-xl */
    font-weight: 700; /* font-bold */
    letter-spacing: -0.025em; /* tracking-tight */
}

.prose p {
    font-size: 1.125rem; /* text-lg */
    color: #4b5563; /* text-gray-700 */
}

/* Estilos de citação */
.prose sup a {
    text-decoration: none;
    font-weight: bold;
    color: #2563eb; /* text-blue-600 */
}
.prose sup a:hover {
    color: #1d4ed8; /* hover:text-blue-700 */
}

/* Lista de referências */
#reference-list {
    list-style: decimal;
    list-style-position: outside;
    margin-left: 1.25rem; /* ml-5 */
    margin-top: 1.5rem; /* mt-6 */
    display: flex;
    flex-direction: column;
    row-gap: 1rem; /* space-y-4 */
    color: #4b5563; /* text-gray-600 */
}
#reference-list li {
    padding-left: 1rem;
    text-indent: -1rem;
}
#reference-list li::marker {
    font-weight: bold;
}

/* Seção de cabeçalho */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem; /* gap-4 */
    padding-bottom: 0.75rem; /* pb-3 */
    border-bottom: 2px solid #3b82f6;
    margin-bottom: 1rem; /* mb-4 */
}

.section-header-icon {
    flex-shrink: 0;
    width: 2.5rem; /* w-10 */
    height: 2.5rem; /* h-10 */
    color: #3b82f6; /* text-blue-500 */
    font-size: 2.5rem; /* Font Awesome icon size */
}

/* Card de informação */
.info-card {
    background-color: #ffffff;
    border-radius: 0.5rem; /* rounded-lg */
    padding: 1.5rem; /* p-6 */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* shadow-md */
    border-left: 4px solid #60a5fa; /* border-l-4 border-blue-400 */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); /* hover:shadow-lg */
}
.info-card h3 {
    margin-top: 0; /* !mt-0 */
}
.info-card p {
    margin-top: 0.75rem; /* !mt-3 */
}
.info-card .info-tag {
    font-size: 0.875rem; /* text-sm */
    font-style: italic; /* italic */
    color: #1e40af; /* text-blue-800 */
    background-color: #dbeafe; /* bg-blue-100 */
    border-radius: 0.375rem; /* rounded-md */
    padding: 0.5rem; /* p-2 */
    margin-top: 1rem; /* !mt-4 */
}

/* Exemplo de tabela */
.example-table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 1.5rem; /* mt-6 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.example-table th {
    background-color: #f9fafb;
    padding: 0.75rem 1rem;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
}
.example-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
}
.example-table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}
.example-table tfoot td {
    font-weight: bold;
    background-color: #f3f4f6;
}

/* Estilos para a seção "How to Use" */
.how-to-use-steps {
    margin-top: 2rem; /* mt-8 */
    display: grid;
    gap: 1.5rem; /* gap-6 */
    grid-template-columns: repeat(1, minmax(0, 1fr)); /* grid-cols-1 */
}

.how-to-use-card {
    background-color: #fff;
    border-radius: 0.5rem; /* rounded-lg */
    padding: 1.5rem; /* p-6 */
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); /* shadow-lg */
    display: flex;
    flex-direction: column;
}
.how-to-use-card span {
    font-size: 3.125rem; /* text-5xl */
    font-weight: 900; /* font-black */
    color: #e5e7eb; /* text-gray-200 */
}
.how-to-use-card h3 {
    font-size: 1.25rem; /* text-xl */
    font-weight: bold; /* font-bold */
    color: #1f2937; /* text-gray-900 */
    margin-top: 0.5rem; /* mt-2 */
}
.how-to-use-card p {
    color: #4b5563; /* text-gray-600 */
    margin-top: 0.5rem; /* mt-2 */
    flex-grow: 1; /* flex-grow */
}

/* Estilos para a seção "Importance" */
.importance-points {
    margin-top: 2rem; /* mt-8 */
    display: grid;
    gap: 2rem; /* gap-8 */
    grid-template-columns: repeat(1, minmax(0, 1fr)); /* md:grid-cols-1 */
}

/* Estilos para a seção "Methods" */
.methods-list {
    margin-top: 2rem; /* mt-8 */
    display: flex;
    flex-direction: column;
    row-gap: 2rem; /* space-y-8 */
}

/* Estilos para a seção "Water Treatment" */
.water-treatment-points {
    margin-top: 2rem; /* mt-8 */
    display: grid;
    gap: 2rem; /* gap-8 */
    grid-template-columns: repeat(1, minmax(0, 1fr)); /* md:grid-cols-1 */
}

/* Estilos para a seção "Curve" */
.curve-explanation-card {
    background-color: #fff;
    padding: 1.5rem; /* p-6 */
    border-radius: 0.5rem; /* rounded-lg */
    margin-top: 1.5rem; /* mt-6 */
    border-left: 4px solid #3b82f6; /* border-l-4 border-blue-500 */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); /* shadow-md */
}
.curve-explanation-card p {
    margin-top: 0; /* Remover margem extra do prose p */
    margin-bottom: 0.5rem; /* Adicionar um pouco de espaçamento */
}
.curve-explanation-card p.mt-4-important { /* Para replicar !mt-4 */
    margin-top: 1rem !important;
}
.curve-types-list {
    list-style: disc;
    list-style-position: inside;
    row-gap: 0.5rem; /* space-y-2 */
    margin-top: 1rem; /* mt-4 */
    color: #1f2937; /* text-gray-800 */
}

.example-table-title {
    font-size: 1.5rem; /* text-2xl */
    font-weight: bold; /* font-bold */
    color: #1f2937; /* text-gray-800 */
    letter-spacing: -0.025em; /* tracking-tight */
    margin-top: 3rem; /* mt-12 */
}

/* Estilos para botões de ação na tabela */
.action-button-remove {
    color: #ef4444; /* text-red-500 */
    background: none;
    border: none;
    padding: 0.25rem; /* p-1 */
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}
.action-button-remove:hover {
    color: #dc2626; /* hover:text-red-700 */
}
.action-button-remove .fas { /* Ícone Font Awesome para remover linha */
    font-size: 1.25rem; /* w-5 h-5 */
}


/* Classes de visibilidade */
.hidden {
    display: none !important;
}

/* Media Queries */
@media (max-width: 1023px) { /* lg: */
    .sidebar {
        transform: translateX(-100%); /* transform: translateX(-100%) */
        z-index: 50;
    }
    .sidebar.open {
        transform: translateX(0); /* transform: translateX(0) */
    }
    #content-overlay {
        display: none;
    }
    .sidebar.open ~ #content-overlay {
        display: block;
    }
    #top-nav-bar {
        display: flex; /* flex, anteriormente oculta em desktop */
    }

    
}

@media (min-width: 640px) { /* sm: */
    th {
        font-size: 1rem; /* sm:text-base */
    }
    .main-padding {
        padding: 1.5rem; /* sm:p-6 */
    }
}

@media (min-width: 768px) { /* md: */
    .how-to-use-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* md:grid-cols-2 */
    }
    .importance-points {
        grid-template-columns: repeat(1, minmax(0, 1fr)); /* md:grid-cols-1 */
    }
}

@media (min-width: 1024px) { /* lg: */
    #main-content {
        margin-left: 16rem; /* margin-left: 16rem */
    }
    #top-nav-bar {
        display: none; /* display: none */
    }
    .how-to-use-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr)); /* lg:grid-cols-3 */
    }
    .importance-points {
        grid-template-columns: repeat(3, minmax(0, 1fr)); /* lg:grid-cols-3 */
    }
    .main-padding {
        padding: 2rem; /* lg:p-8 */
    }
    .prose h1 {
        font-size: 2.75rem; /* lg:text-5xl */
    }
    .prose h2 {
        font-size: 2.25rem; /* lg:text-4xl */
    }
    .prose h3 {
        font-size: 1.5rem; /* lg:text-2xl */
    }
    .prose p {
        font-size: 1.25rem; /* lg:text-xl */
    }

    .results-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 colunas em telas grandes */
    }
}

/* Ko-fi widget positioning */
#kofi-widget-overlay {
    right: 20px !important; /* Move to the right */
    left: auto !important; /* Ensure it doesn't try to go left */
}