* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

:root {
    --azul-principal: #4a90e2;
    --azul-hover: #377ccc;
    --verde-entrada: #28a745; /* Azul para cabeçalhos e elementos de destaque */
    --verde-sucesso: #50e3c2; /* Verde para indicar receitas e ações positivas */
    --laranja-alerta: #f5a623;
    --vermelho-botao: #f11329fd; /* Laranja para alertas e status pendentes */
    --vermelho-despesa: #db2e42; /* Vermelho para indicar despesas e ações negativas */
    --cinza-texto: #4a4a4a;
    --preto-texto: #2e2e2e;
    --cinza-texto-claro: #777; /* Cinza escuro para textos principais */
    --cinza-1: #f3f3f3;
    --cinza-2: #cac8c8;
    --cinza-3: #b3b3b3; /* Cinza bem claro para o fundo de seções */
    --branco-puro: #ffffff; /* Branco para os cards e áreas de conteúdo */
}

body {
    width: 100vw;
    height: 100vh;
    padding: 0 30px;
    background: var(--cinza-claro);
}

.container {
    height: 100%;
    width: 100%;
    position: relative;
}

/* inicio header -----------------------------------------*/

header {
    background-color: var(--azul-principal);
    color: #fff;
    display: flex;
    height: 80px;
    width: 100%;
    position: fixed;
    left: 0;
    right: 0;
    box-shadow: 1px 2px 3px var(--cinza-2);
    z-index: 11;
}

.logo {
    margin: auto 0;
}

.logo a {
    color: var(--laranja-alerta);
    font-size: 2rem;
    text-decoration: none;
    font-weight: 600;
}

nav {
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

ul {
    width: 60%;
    display: flex;
    justify-content: end;
    align-items: center;
}

li {
    list-style: none;
}

/*--------------------------------início dropdown ------------------------------------ */
.dropdown-container {
    position: relative;
}

.dropdown-btn,
.btn-opcoes {
    padding: 10px;
    width: 100%;
    color: var(--branco-puro);
    border: none;
}

.dropdown-btn {
    background: transparent;
    min-width: 200px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 10px;
    transition: ease-in 0.2s;
}

.dropdown-btn:hover {
    background: #1414144f;
}

.drop-menu-botoes,
.drop-menu-campo-filter {
    border-radius: 10px;
    background-color: var(--branco-puro);
    border: solid 1px var(--cinza-3);
    box-shadow: 1px 5px 10px var(--preto-texto);
    min-width: 200px;
    flex-direction: column;
    position: absolute;
    top: 0;
    right: -10px;
    display: none;
    z-index: 12;
}

/* adicionando essas classe com js para o dropdown ficar visível */
.show {
    display: flex;
    top: 60px;
}

.btn-opcoes {
    color: var(--preto-texto);
    background: var(--branco-puro);
    text-align: start;
}

.btn-opcoes:hover {
    background: var(--cinza-2);
}

#btn-filtra-por-data {
    border-radius: 10px 10px 0 0;
}

button a {
    color: var(--preto-texto);
    text-decoration: none;
}

.fechar {
    color: #c0392b;
    border-radius: 0 0 10px 10px;
}

/* dropdown select para filtro--------------------------- */
.drop-menu-campo-filter {
    width: 450px;
    height: 120px;
    position: absolute;
    right: -30%;
    left: 30%;
    top: 100px;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

#container-campo-filter {
    width: 95%;
    height: 70px;
    display: flex;
    align-items: end;
    justify-content: space-between;
}

.campo-label {
    width: 260px;
    display: flex;
    flex-direction: column;
}

.campo-label label {
    margin: 2px 10px;
    color: #000000;
}

#campo-filter {
    width: 100%;
    height: 40px;
    border: solid 1px var(--cinza-texto);
    background: var(--branco-puro);
    box-shadow: 1px 2px 3px var(--preto-texto);
    border-radius: 10px;
    outline: none;
}

.botao-azul.filter {
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.overlay-dropdown {
    position: fixed;
    background-color: #000000;
    opacity: 0.7;
    z-index: 10;
    left: -2000px;
    transition: ease-in 0.3s;
}

.overlay-dropdown.active {
    display: flex;
    top: 80px;
    left: -5px;
    width: 100%;
    height: 100%;
}
/*------------------------------- fim dropdown-------------------------------------- */

/* --------------------------------fim header ---------------------------------------*/

main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* -------------------------------início seção resumo ---------------------------------*/
.cards-resumo {
    width: 100%;
    height: 200px;
    margin-top: 100px;
    padding-top: 10px;
    border-radius: 10px;
    border: solid 1px var(--cinza-2);
    box-shadow: 1px 2px 3px var(--cinza-2);
    background-color: var(--cinza-1);
    display: flex;
    justify-content: space-around;
    position: relative;
}

.container-mensagem {
    position: absolute;
    bottom: 10px;
    width: 25%;
    height: 50px;
    background: var(--branco-puro);
    border: solid 2px var(--cinza-3);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 1px 2px 3px var(--cinza-3);
}

.msg-alerta {
    overflow-wrap: break-word;
    text-align: center;
    font-weight: 600;
    color: var(--cinza-3);
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: solid 1px var(--cinza-2);
    background: var(--branco-puro);
    height: 50%;
    width: 25%;
    min-width: 200px;
    border-radius: 10px;
    box-shadow: 1px 2px 3px var(--cinza-3);
}

.card h5 {
    font-size: 1rem;
    color: var(--cinza-texto-claro);
}

.card p {
    font-size: 1.3rem;
    font-weight: 700;
}

.title-card {
    display: flex;
    gap: 10px;
}

.title-card,
.arrow-up {
    color: var(--verde-entrada);
}

.arrow-down {
    color: var(--vermelho-despesa);
}

.icon-carteira {
    color: var(--azul-principal);
}

#total-entradas {
    color: var(--verde-entrada);
}

#total-despesas {
    color: var(--vermelho-despesa);
}

#saldo {
    color: var(--azul-principal);
}

form {
    display: grid;
    grid-template-columns: auto auto;
    gap: 0 30px;
    justify-content: center;
    align-items: end;
    background-color: var(--cinza-1);
    padding: 20px;
    border-radius: 10px;
    border: solid 1px var(--cinza-2);
    box-shadow: 1px 2px 3px var(--cinza-2);
    margin-top: 30px;
    width: 100%;
}

.tipo-de-transacao {
    width: 200px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tipo-de-transacao h3 {
    margin-bottom: 10px;
    color: var(--preto-texto);
}

.radios {
    display: flex;
    width: 200px;
    justify-content: space-between;
}

#tipo-entrada,
#tipo-saida {
    box-shadow: none;
}

.campos-de-entrada {
    display: grid;
    grid-template-columns: auto auto auto auto;
    gap: 30px;
    grid-column: 1 / 2;
    align-items: end;
}

.campo {
    display: flex;
    flex-direction: column;
    max-width: 240px;
    min-width: 200px;
}

input,
select {
    padding: 10px;
    border-radius: 10px;
    border: solid 1px var(--cinza-texto);
    box-shadow: 1px 2px 3px var(--cinza-3);
}

.valor-active::placeholder {
    color: var(--vermelho-despesa);
    font-weight: 600;
}

.botao-azul {
    background: var(--azul-principal);
    color: var(--branco-puro);
    border: none;
    border-radius: 10px;
    height: 42px;
    max-width: 240px;
    min-width: 200px;
    grid-column: 2 / 3;
    box-shadow: 1px 2px 3px var(--cinza-3);
}

.botao-azul:hover {
    background: var(--azul-hover);
}

.transacoes {
    width: 100%;
    height: auto;
    margin-top: 40px;
    border-radius: 10px;
    background: var(--cinza-1);
    border: solid 1px var(--cinza-2);
    box-shadow: 1px 2px 3px var(--preto-texto);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 50px;
}

.transacoes h3 {
    text-align: center;
    font-size: 1.5rem;
    color: var(--preto-texto);
}

.linha {
    width: 100%;
    max-width: 800px;
    height: 2px;
    background-color: var(--cinza-3);
}

.mensagem-campo-transacoes {
    text-align: center;
}

.container-transacao {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.transacao {
    width: 100%;
    max-width: 1200px;
    height: 60px;
    border: solid 2px var(--cinza-3);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    color: var(--preto-texto);
}

.transacao.active {
    border: solid 2px var(--vermelho-despesa);
}

.div-icon-categoria {
    display: flex;
    width: 120px;
    gap: 5px;
}

.forma-transacao {
    width: 64px;
}

.data-transacao {
    width: 90px;
}

.valor-transacao {
    font-size: 1.1rem;
    font-weight: 600;
    width: 120px;
}

.btn-excluir-transacao {
    width: 100px;
    height: 40px;
    border: solid 2px var(--vermelho-despesa);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: ease 0.4s;
    color: var(--preto-texto);
}

.btn-excluir-transacao:hover {
    background: var(--vermelho-botao);
    color: var(--branco-puro);
}

.btn-excluir-transacao.mobile {
    background: transparent;
    display: none;
}

/* *********************************início transações filtradas ***************************** */

.transacoes.filtradas {
    max-width: 500px;
    z-index: 13;
    position: absolute;
    top: 60px;
    left: -750px;
    transition: ease-in-out 0.5s;
    padding: 70px 10px;
}

.transacoes.filtradas.active {
    left: 0;
}

.lista {
    width: 100%;
    display: block;
}

.div-icon-categoria.filtrada {
    flex-direction: column;
    width: 100px;
}

.transacao-filtrada {
    display: flex;
    border: solid 1px var(--cinza-texto-claro);
    width: 100%;
    height: 60px;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 2px 3px 8px;
    background: var(--branco-puro);
    margin-top: 20px;
}

.forma-valor {
    width: 40%;
}

.valor-transacao-filtrada {
    font-weight: 600;
    font-size: 1rem;
}

.tipo-transacao-filtrada {
    grid-column: 2 / 3;
}

.btn-fecha-transacao {
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    width: 100px;
    height: 40px;
    border-radius: 5px;
    position: absolute;
    top: 10px;
    left: 10px;
}

.btn-fecha-transacao:hover {
    background: #0000000a;
    border: solid 2px var(--cinza-3);
}

/************************************ fim transações filtradas ***********************/

/* medias queries */

@media (max-width: 1200px) {
    form {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 20px;
    }

    .campos-de-entrada {
        grid-template-columns: 1fr 1fr;
        grid-column: 1 / -1;
        justify-items: center;
        justify-self: center;
    }

    #btn-registrar {
        grid-column: 1 / -1;
        grid-row: 3 / 4;
        max-width: none;
        width: 438px;
        justify-self: center;
    }
}

@media (max-width: 780px) {
    .transacoes {
        padding: 30px;
    }

    .transacao {
        height: auto;
        display: grid;
        grid-template-columns: auto auto auto;
        grid-template-rows: auto auto;
        position: relative;
    }

    .div-icon-categoria {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
    .btn-excluir-transacao {
        grid-column: 3 / 4;
    }

    .valor-transacao {
        grid-column: 2 / 3;
        width: 100px !important;
    }

    .forma-transacao {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        font-weight: 600;
    }

    .data-transacao {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }

    .btn-excluir-transacao {
        position: absolute;
        top: 12px;

        right: 0;
    }

    body {
        padding: 0 10px;
    }
}

@media (max-width: 660px) {
    .drop-menu-botoes {
        right: 40px;
    }

    .drop-menu-campo-filter {
        width: 250px;
        height: 200px;
        left: 80px;
    }

    #container-campo-filter {
        width: 100%;
        height: 300px;
        display: flex;
        flex-direction: column;
        gap: 5px;
        align-items: center;
        padding: 20px;
    }

    .campo-label {
        width: 100%;
        height: auto;
    }

    .botao-azul.filter {
        width: 100%;
    }

    .cards-resumo {
        display: grid;
        grid-template-columns: auto auto;
        grid-template-rows: auto auto auto;
        padding: 20px 0;
        height: 280px;
     
    }

    

    .container-mensagem {
        width: 100%;
        grid-column: 1 / -1;
        justify-self: center;
    }

    .receita {
        grid-column: 1 / 2;
        height: 70px;
    }

    .despesa {
        grid-column: 2 / 3;
        height: 70px;
    }

    .total {
        grid-column: 1 / -1;
        width: 100%;
        height: 60px;
    }

    .tipo-de-transacao {
        justify-self: center;
    }

    .campos-de-entrada {
        grid-template-columns: auto;
    }

    .botao-e-campos-de-entrada {
        max-width: 310px !important;
        width: 100%;
        /* padding: 10px; */
    }

    .campo {
        width: 100%;
        max-width: none;
    }

    .btn-excluir-transacao {
        display: none;
    }

    .btn-excluir-transacao.mobile {
        width: 40px;
        display: block;
        border: none;
        font-size: 1.5rem;
        display: block;
    }
}

@media (max-width: 460px) {
    .card.despesa,
    .card.receita {
        min-width: 140px;
    }
    .transacoes {
        padding: 5px;
    }

    .div-icon-categoria,
    .valor-transacao,
    .forma-transacao,
    .data-transacao {
        font-size: 0.9rem;
    }

    .transacao {
        position: relative;
    }
    .btn-excluir-transacao {
        font-size: 0.8rem;
        position: absolute;
        right: -15px;
        .campo {
            width: 100%;
        }

        #data {
            width: 100%;
        }
    }
}
