@import '../../../main-styles.scss';

.root {
    display: flex;
    width: 100%;
    position: relative;

    &:hover {
        .x-icon-button {
            opacity: 1;
            transform: scale(1);
        }
    }
    
    .x-icon-button {
        position: absolute;
        height: 34px;
        width: 34px;
        border-radius: 50%;
        background: $dark;
        background-image: url('../../../assets/delete_icon.svg');
        background-repeat: no-repeat;
        background-position: center;
        right: -17px; // this has to be half of the width
        top: -17px; // this has to be half of the height

        transition: opacity 0.2s ease-out, transform 0.2s ease-out;
        
        transform: scale(0);
        opacity: 0;

        cursor: pointer;

        &:hover {
            transform: scale(1.2);
        }
    }
}

.budget-item {
    display: flex;
    width: 100%;
    background-color: $light-grey;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;

    transition: background-color 0.2s ease-out;
    &:hover {
        background-color: darken($light-grey, 2%);
    }

    .description {
        display: flex;
        flex-grow: 1;
        font-size: 18px;
        margin-left: 5px;

        // Vertically center the children elements
        align-items: center;
    }

    .amount {
        padding: 5px;
        border-radius: 3px;
    }
}

.expense {
    p {
        color: $red;
    }

    .amount {
        background-color: $light-red;
    }
}

.income {
    p {
        color: $green;
    }

    .amount {
        background-color: $light-green;
    }
}