/* ______ Reset ______ */
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
}

:root {
    /* ______ Colors ______ */
    /* ___ Primary ___ */
    --Purple-500: hsl(259, 100%, 65%);
    --Red-400: hsl(0, 100%, 67%);
    /* ___ Neutral ___ */
    --White: hsl(0, 100%, 100%);
    --Grey-100: hsl(0, 0%, 94%);
    --Grey-200: hsl(0, 0%, 86%);
    --Grey-500: hsl(0, 1%, 44%);
    ---Black: hsl(0, 0%, 0%);

    /* ______ Fonts ______ */
    --text-body: 32px;
    --font-Poppins: "Poppins", sans-serif;
}


body {
    width: 100vw;
    min-height: 100vh;
    font-size: var(--text-body);
    font-family: var(--font-Poppins);
    color: var(---Black);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background-color: var(--Grey-100);
    overflow: hidden;
}


main {
    position: relative;
    background-color: var(--White);
    padding: 24px;
    border-radius: 12px;
    border-bottom-right-radius: 100px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    color: var(---Black);
    width: 355px;
    max-width: 100%;
    box-shadow: 4px 4px 2px var(---Black);

    @media screen and (min-width:577px) {
        width: 420px;
    }
}

form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--Grey-200);
    width: max-content;
    color: var(--Grey-500);


    div {
        display: flex;
        flex-direction: column;
        gap: 2px;
        width: 80px;
        text-transform: uppercase;

        label {
            font-size: 8px;
            font-weight: 600;
            letter-spacing: 1px;
            color: inherit;
        }


        input {
            border: 1px solid var(--Grey-200);
            max-width: 100px;
            padding: 8px;
            border-radius: 4px;
            font-weight: 800;
            font-size: 16px;
            width: 100%;
            cursor: pointer;

            &:hover,
            &:focus {
                border-color: var(--Purple-500);
            }
        }

        .err-message {
            font-size: 10px;
            /* width: 100%; */
            text-transform: capitalize;
            color: inherit;
            /* width: max-content; */
            margin-top: 5px;
        }

        &.error {
            color: var(--Red-400);

            input {
                border-color: var(--Red-400);
            }
        }
    }

    button {
        border-radius: 50%;
        background-color: var(--Purple-500);
        position: absolute;
        width: 48px;
        height: 48px;
        left: 50%;
        top: 100%;
        transform: translate(-50%, -50%);
        padding: 10px;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 4px 4px 1px var(---Black);

        img {
            width: 100%;
        }

        &:hover {
            background-color: var(---Black);
        }

        /* ____ Desktop ____ */
        @media screen and (min-width:577px) {
            left: calc(100% - 24px);
            transform: translate(0, -50%);
        }
    }

    /* ____ Desktop ____ */
    @media screen and (min-width:577px) {
        padding-right: 64px;
        padding-bottom: 24px;
    }

}





.result {
    font-size: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-style: italic;
    font-weight: 800;

    span {
        color: var(--Purple-500);
        letter-spacing: 8px;
        margin-right: -15px;
    }
}


.save {
    position: absolute;
    bottom: 80%;
    left: 50%;
    transform: translate(-50%, 0);
    border-radius: inherit;
    width: max-content;
    height: max-content;
    display: flex;
    justify-content: start;
    align-items: center;
    gap: 24px;
    transition: bottom .5s ease;
    z-index: -1;

    .save-btn {
        color: var(--Purple-500);
        position: relative;
        cursor: pointer;
        /* position: absolute;
        right: 100%;
        top: 50%;
        transform: translate(0,-50%);   */
        font-size: 50px;

        span {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            color: var(--White);
            font-size: 12px;
        }

        &:hover {
            color: var(---Black);
        }


    }

    input {
        height: 100%;
        width: 100%;
        padding: 12px;
        border-radius: inherit;
        background-color: var(--White);
        box-shadow: 4px 4px 2px var(---Black);
    }

    .err {
        font-size: 10px;
        position: absolute;
        top: 0;
        left: 30%;
        color: var(--Red-400);
        display: none;
    }

    &.active {
        bottom: 100%;
        z-index: 1;
    }
}


.bookmarks {
    position: fixed;
    right: 24px;
    top: 24px;
    font-size: 14px;
    cursor: pointer;
    display: none;
    z-index: 2;

    .title {
        background-color: var(--White);
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 12px;
        padding: 10px;
        border-radius: 4px;

        i {
            color: var(--Purple-500)
        }
    }

    .list {
        position: absolute;
        list-style: none;
        width: 100%;
        background-color: var(--White);
        left: 0;
        top: -100vh;
        border-radius: 4px;
        transition: top .5s ease;

        li {
            padding: 4px 12px;
            cursor: pointer;
            width: 100%;
            background-color: inherit;

            &:not(:last-child) {
                border-bottom: 1px solid var(--Grey-100);
            }

            &:hover {
                background-color: var(--Purple-500);
                color: var(--White);
            }
        }

        &.active {
            top: 110%;
        }
    }


    &.active {
        display: block;
    }
}

.saved-msg {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: rgb(46, 142, 38);
    color: var(--White);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    justify-content: center;
    align-items: center;
    gap: 12px;
    box-shadow: 4px 4px 2px var(---Black);
    display: none;

    &.active {
        display: flex;
    }
}