/* Header */
header {
    width: 100%;
    background: var(--purple-dark);
    
    text-align: center;
    padding: 3rem 3rem 18rem 3rem;

    display: flex;
    align-items: center;
    justify-content: center;
}
header h1 {
    display: flex;
    align-items: center;
    color: #f1f2f2;

    font-size: 2.6rem;
    font-weight: bold;
}
header .purple {
    color: var(--purple);
}




/* titles */
h2 {
    margin-top: 1rem;
    margin-bottom: 0.8rem;

    color: var(--title);

    font-size: 2.2rem;
    font-weight: 400;
}




/* main balance */
main #balance {
    width: 100%;
    
    display: grid;
    grid-template-areas: 
    "title title title"
    "input output total";
    grid-column-gap: 3.2rem;

    margin-top: -8rem;
} 
main #balance h2 {
    color: var(--white)
} 

/* balance cards */
.title-card {
    grid-area: title;
}
.input {
    grid-area: input;
}
.output {
    grid-area: output;
}
.total {
    grid-area: total;
}
main #balance .card-balance {
    background: var(--white);

    border-radius: .5rem;
    padding: 2rem 2rem 3.2rem 2rem;

}
main #balance .card-balance p {
    font-size: 3.2rem;
    font-weight: bold;

    color: var(--title);

    /* filter: blur(.6rem); */
}
main #balance .card-balance.total {
    background: var(--purple);
}
main #balance .card-balance.total p, 
main #balance .card-balance.total h3 {
    color: var(--white) !important;
} 

/* title cards */
main #balance .card-balance .title-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 1.4rem;
}
main #balance .card-balance .title-card h3 {
    font-size: 1.6rem;
    font-weight: 400;

    color: var(--title);
}
main #balance .card-balance .title-card img {
    width: 4rem;
    height: 4rem;
}




/* Main Transaction */
main #transaction {
    width: 100%;

    display: block;
    overflow: auto;

    margin-top: 6.4rem;
    margin-bottom: 7rem;
}
main #transaction .button {
    color: var(--green);

    display: inline-block;
    margin-bottom: 1rem;

    font-size: 1.6rem;

    transition: color .15s ease;
}
main #transaction .button.new:hover {
    color: #3DD705;
}

/* Transaction table */
main #transaction #data-table {
    width: 100%;
    text-align: left;

    border-spacing: 0 .8rem;

}
main table td, main table th{
    background: var(--white);

    padding: 2rem 3.2rem;

    font-size: 1.6rem;
}
main table th {
    background: rgba(134, 0, 207, .9) !important;

    color: var(--white);
    font-weight: normal;
}
main table td:first-child,
main table th:first-child{
    border-radius: .5rem 0 0 .5rem;
}
main table td:last-child,
main table th:last-child {
    border-radius: 0 .5rem .5rem 0;
}
main table tbody tr {
    opacity: .75;
    transition: opacity .15s ease;
}
main table tbody tr:hover {
    opacity: 1;
}
main table .description {
    color: var(--title)
}
main table .income {
    color: var(--green)
}
main table .expense {
    color: var(--red)
}
main table .date {
    color: var(--text)
}



/* Modal */
#modal-overlay {
    width: 100%;
    height: 100%;

    position: fixed;
    top: 0;
    left: 0;

    background: rgba(0, 0, 0, .7);

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;

    z-index: 5;
}
#modal-overlay.active-modal {
    opacity: 1;
    visibility: visible;
}
#modal-overlay .modal {
    padding: 2.8rem;
    background: var(--background);
}
.modal-form {
    max-width: 50rem;
}
.modal-form .title-modal {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    justify-content: space-between;
}
.modal-form .title-modal #error {
    font-size: 1.2rem;
    font-weight: bold;

    color: var(--red);

    opacity: 0;
    visibility: hidden;

    transform: translateX(50%);

    transition: all .2s linear;
}
.modal-form .title-modal #error.active-error {
    opacity: 1;
    visibility: visible;
    transform: translateX(0%);

}
.modal-form h2 {
    margin-top: 0;
}
.modal-form form input {
    padding: 1.5rem;
    margin-bottom: 1rem;

    background: var(--white);
    width: 100%;

    border: 0;
    border-radius: .3rem;

    outline: none;
}
.modal-form form .message-help {
    display: inline-block;
    color: var(--text);

    font-size: 1.2rem;

    margin-bottom: 2rem;
}
.modal form .actions {
    width: 100%;

    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 1rem;
}
.modal form .actions .button,
.modal form .actions button {
    padding: 1.6rem 0;
    border-radius: .3rem;

    text-align: center;
    font-size: 1.6rem;
    font-weight: 500;

    cursor: pointer;
    opacity: .75;

    transition: opacity .15s ease;
}
.modal form .actions .button:hover,
.modal form .actions button:hover {
    opacity: 1;
}
.modal form .actions .cancel {
    border: 3px solid var(--red);
    color: var(--red);
}
.modal form .actions button {
    background: var(--green);
    color: var(--white);
    border: 0;
}


/* footer */
footer {
    width: 100%;
    text-align: center;

    padding: 1rem;
}
footer p {
    margin: 2rem 0;
    font-size: 1.8rem;

    color: var(--title);
}
footer p:nth-child(1) {
    font-weight: bold;
}
footer p a{
    display: inline-block;
    color: var(--purple);
    text-decoration: underline;

    transition: all .3s ease;
}
footer p a:hover {
    transform: scale(1.04);
}
footer .green {
    color: #227EF0;
}



/* MediasQueries - Responsive */
@media (max-width: 940px) {
    main #balance {
        grid-template-areas: 
        "title"
        "input"
        "output"
        "total";
        grid-row-gap: 3.2rem;
        grid-column: 0;

        margin-top: -16rem;
    }

   
}