/* style.css */

/* Importa a fonte Rubik do Google Fonts (link correto) */
@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');
:root {
    --cor-primaria: #4CAF50;
    --cor-secundaria: #388E3C;
    --cor-fundo-inicio: #e8f5e9;
    --cor-fundo-fim: #ffffff;
}
/* Estiliza o corpo da página */
body {
    font-family: "Rubik", sans-serif;
    background: linear-gradient(135deg, var(--cor-fundo-inicio), var(--cor-fundo-fim));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.visually-hidden {
  position: absolute;
  left: -9999px;
}

/* Estiliza a tag header */
header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px;
    padding: 40px 0;
}

/* Estiliza a seção que contém o formulário de pesquisa */
/* A seção principal já tem display: flex e flex-direction: column */
main section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
}

/* Estiliza o formulário de pesquisa para centralizar seus elementos */
form {
    display: flex; /* Transforma o formulário em um contêiner flex */
    flex-direction: column; /* Coloca os itens (input e button) em coluna */
    align-items: center; /* Centraliza horizontalmente os itens dentro do formulário */
    width: 100%; /* Garante que o formulário ocupe a largura total de sua seção pai */
    gap: 1.5rem;
}


/* Estiliza os inputs dentro das seções */
section input {
    width: 30rem;
    padding: 1rem;
    border-radius: 2rem;
    border: 2px solid var(--cor-primaria);
    outline: none;
    transition: 0.3s;
}

section input:focus {
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.4); /* (Pode deixar essa como RGBA pela opacidade) */
}
/* Suaviza o texto de dica dentro do input */
section input::placeholder {
    color: #a0aab2;
    font-style: italic;
    opacity: 0.8;
}
/* Removido: flex-direction, display, justify-content, align-items, pois o form já fará isso */

/* Estiliza os botões dentro das seções */
section button {
    background: var(--cor-primaria);
    color: white;
    font-weight: bold;
    transition: 0.3s;
    padding: 1rem 2rem; /* Deixa o botão mais "gordinho" */
    border: none; /* Tira a borda padrão feia do navegador */
    border-radius: 2rem; /* Deixa as pontas arredondadas igual a barra de pesquisa */
    cursor: pointer; /* Faz a setinha do mouse virar uma "mãozinha" ao passar por cima */
}
/* Removido: flex-direction, display, justify-content, align-items, pois o form já fará isso */

/* Adiciona efeito hover ao botão de pesquisa */
section button:hover {
    background: var(--cor-secundaria);
    transform: scale(1.05);
}

/* Estiliza a caixa de resultados da pesquisa */
#resultados-pesquisa {
    width: 60rem;
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 1rem;
    border-radius: 1rem;
    padding: 2rem;
    background-color: #FFFFFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #45474B;
    margin-bottom: 3rem;
    display: none;
}

/* Estiliza cada item de resultado (bloco principal da cidade) */
.item-resultado {
    background: #F5F7F8;
    border-radius: 0.6rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: 0.3s;
}

.item-resultado:hover {
    transform: translateY(-5px);
}
/* Estiliza a mensagem quando a cidade não é encontrada */
.mensagem-erro {
    text-align: center;
    color: #e74c3c; /* Um tom de vermelho/laranja suave */
    font-weight: bold;
    font-size: 1.2rem;
    padding: 2rem;
    background-color: #fdf5f5;
    border-radius: 0.6rem;
    border: 1px dashed #e74c3c;
}
.item-resultado h2 {
    font-size: 1.8rem;
    color: #222831;
    margin-top: 0;
    margin-bottom: 10px;
}

.item-resultado p {
    margin-bottom: 5px;
    line-height: 1.5;
    color: #45474B;
}

.item-resultado a {
    text-decoration: none;
    color: #30475E;
    font-weight: bold;
}

.item-resultado a:hover {
    text-decoration: underline;
}

/* Estilos para a seção de pontos de coleta */
.pontos-coleta-section h3 {
    color: #222831;
    margin-top: 2rem;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.4rem;
}

/* Estilos para a tabela de pontos de coleta */
.tabela-pontos-coleta {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: #FFFFFF;
    border-radius: 0.6rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tabela-pontos-coleta th,
.tabela-pontos-coleta td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #E0E0E0;
    color: #45474B;
    vertical-align: top;
}

.tabela-pontos-coleta th {
    background-color: #F5F7F8;
    color: #222831;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85em;
}

.tabela-pontos-coleta tbody tr:nth-child(even) {
    background-color: #F9F9F9;
}

.tabela-pontos-coleta tbody tr:hover {
    background-color: #EFEFEF;
}

.tabela-pontos-coleta td a {
    color: #30475E;
    text-decoration: none;
}

.tabela-pontos-coleta td a:hover {
    text-decoration: underline;
}

/* Estiliza o rodapé da página */
footer {
    background: linear-gradient(135deg, #e8f5e9, #ffffff);
    color: #3d3c3c;
    text-align: center;
    padding: 0;
    width: 100%;
    margin-top: auto;
    font-size: 75%;
}

/* Responsividade */
@media (max-width: 768px) {
    section input {
        width: 25rem;
        padding: 0.8rem;
    }

    #resultados-pesquisa {
        width: 90%;
        max-height: 70vh;
        height: auto;
    }

    .item-resultado h2 {
        font-size: 1.3rem;
    }

    /* Responsividade para a tabela em telas menores */
    .tabela-pontos-coleta,
    .tabela-pontos-coleta thead,
    .tabela-pontos-coleta tbody,
    .tabela-pontos-coleta th,
    .tabela-pontos-coleta td,
    .tabela-pontos-coleta tr {
        display: block;
    }

    .tabela-pontos-coleta thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .tabela-pontos-coleta tr {
        border: 1px solid #E0E0E0;
        margin-bottom: 10px;
        border-radius: 0.6rem;
    }

    .tabela-pontos-coleta td {
        border: none;
        border-bottom: 1px solid #E0E0E0;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    .tabela-pontos-coleta td:before {
        position: absolute;
        top: 6px;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
    }

    /* Rótulos para cada coluna */
    .tabela-pontos-coleta td:nth-of-type(1):before { content: "Tipo de Resíduo:"; }
    .tabela-pontos-coleta td:nth-of-type(2):before { content: "Nome/Serviço:"; }
    .tabela-pontos-coleta td:nth-of-type(3):before { content: "Endereço / Contato:"; }
    .tabela-pontos-coleta td:nth-of-type(4):before { content: "Observações:"; }
}

@media (max-width: 480px) {
    section input {
        width: 17rem;
    }

    section button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    #resultados-pesquisa {
        width: 95%;
        max-height: 60vh;
        height: auto;
    }

    .item-resultado h2 {
        font-size: 1.1rem;
    }

    footer {
        font-size: 0.9rem;
    }

    /* Ajustes para a tabela em telas muito pequenas */
    .tabela-pontos-coleta td {
        padding-left: 40%;
    }
    .tabela-pontos-coleta td:before {
        width: 35%;
    }
    /* Estiliza a barra de rolagem da caixa de resultados */
#resultados-pesquisa::-webkit-scrollbar {
    width: 8px; /* Deixa a barra mais fininha e elegante */
}

#resultados-pesquisa::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 10px;
}

#resultados-pesquisa::-webkit-scrollbar-thumb {
    background: var(--cor-primaria); /* Usa o seu verde! */
    border-radius: 10px;
}

#resultados-pesquisa::-webkit-scrollbar-thumb:hover {
    background: var(--cor-secundaria); 
}
}
