/* #region   ------------------------------------------             GENERAL CHANGES         ---------------------------------------------------             */

main{
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
 
    
}

.dashboard-container{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    grid-template-areas: 
    "d1 d2 d5"
    "d3 d3 d4"
    ;
    gap: 15px;
    padding: 20px;
    width: 95%;    
}

/* #endregion */

/* #region   ------------------------------------------          BALANCE DISPLAYER            ---------------------------------------------------             */

.balance-displayer{
    grid-area: d1;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

section{
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.grid-card{
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    background-color: var(--alternated-row-color);
    flex: 1;
    border-bottom: 1px solid hsla(180, 12%, 95%, 0.316);
    transition: .15s;
}

.grid-card i{
    width: 25px;
}

.grid-anchor:hover{
    cursor: pointer;
    background-color: var(--alternated-dashboard-hover);
}


.grid-card:nth-child(2n){
    background-color: var(--row-color);
    
}

.grid-anchor:nth-child(2n):hover{
    background-color: var(--dashboard-hover);
}

.balance-gridContainer{
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
}

.balance-textContainer{
    display: flex;
    flex-direction: column;
}

.balance-textContainer span{
    font-size: 14px;
}


/* #endregion */

/* #region   ------------------------------------------             GOAL TRACKER         ---------------------------------------------------             */

.goal-tracker{
    grid-area: d2;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-grow: 1;
}

.grid-header{
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: var(--titles-color);
    border-bottom: 1px solid hsla(180, 12%, 95%, 0.316);
}

.progress-row{
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.progress-bar{   
    width:100%;
    height: 20px;
    border-radius: 20px;
    background-color: var(--goal-bar);
    overflow: hidden;
}

.progress-accomplished{
    height: 100%;
    background: linear-gradient(to right, hsl(42, 76%, 57%), hsl(99, 100%, 50%));
    transition: width 0.5s ease-in-out;
    
}

.progress-barContainer{
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 10px;
}

.bar-containerGoal{
    text-align: end;
}

/* #endregion */

/* #region   ------------------------------------------             BAR GRAPH         ---------------------------------------------------             */

.monthly-expenses{
    grid-area: d3;
    display: block;
    max-height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: var(--graph-bg-color);
}

.bar-graph {
    max-height: 360px;
    padding: 0px 5px 5px 5px;

}


/* #endregion */

/* #region   ------------------------------------------             TRANSACTION HISTORY         ---------------------------------------------------             */

.transactions-container{
    grid-area: d4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.transactions-redirect{
    text-align: end;
    background-color: var(--titles-color);
    padding: 10px;
}

.transactions-redirect a{
    padding: 5px 15px;
    border-radius: 20px;
}

.transactions-redirect a:hover{
    background-color: var(--form-hover-color);
    transition: .15s;

}

.transactions-history{
    width: 100%;
    background-color: var(--alternated-row-color);
    table-layout: fixed;
    border-collapse: collapse;
    text-align: center;
    flex-grow: 1;
}

caption{
    text-align: center;
    font-weight: bold;
    padding: 20px;
    background-color: var(--titles-color);
    border-bottom: 1px solid hsla(180, 12%, 95%, 0.316);
}

td{
    padding: 5px 15px;
}

th{
    padding: 5px 15px;
    background-color: var(--row-header);
    border-bottom: 1px solid hsla(180, 12%, 95%, 0.316);
}

.grid-card:last-child{
    border-bottom: none;
}

.table-row{
    border-bottom: 1px solid hsla(180, 12%, 95%, 0.316);
}

tr:nth-of-type(2n){
    background-color: var(--row-color);
}

.transaction-th{
    word-break: break-word;
}

/* #endregion */

/* #region   ------------------------------------------             DOUGHNUT GRAPH         ---------------------------------------------------             */

.expenses-doughnut{
    grid-area: d5;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--graph-bg-color);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.doughnut-graph{
    padding: 20px;
    max-width: 500px;
    max-height: 400px;
}

/* #endregion */

/* #region   ------------------------------------------             MEDIA QUERIES          ---------------------------------------------------             */

@media (max-width: 1100px){

    .dashboard-container{
        grid-template-areas: 
        "d1 d2"
        "d5 d4"
        "d3 d3"
        ;
    }
    

}


@media (max-width: 900px){

    .dashboard-container{
        padding: 0;
        gap: 20px;
        width: 100%;
        grid-template-areas: 
        "d1"
        "d2"
        "d5"
        "d4"
        "d3"

        ;
    }

    .balance-displayer,
    .goal-tracker,
    .monthly-expenses,
    .transactions-container,
    .expenses-doughnut{
        width: 100%;
    }

    section{
        box-shadow: none;
    }
    
    

    
}

@media (max-width: 500px){

    .grid-card,
    .progress-row{
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 10px;
    

    }

    main{
        padding: 10px;
    }

    .grid-anchor{
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    td{
        padding: 5px 5px;
    }

    th{
        padding: 5px 5px;
        font-size: 1.1rem;
    }

}

/* #endregion */


