@import "tailwind-colors.css";

@font-face {
    font-family: "Poppins-Regular";
    src: url("fonts/Poppins-Regular.ttf");
}

/* Define our own variables */
:root {
    --background-color: var(--color-zinc-50);
    --text-color: var(--color-gray-800);
    --font-size: 35px;

    --button-bg: var(--color-zinc-100);
    --button-border: var(--color-zinc-400);

    --gradient-degree: 45deg;

    --button-hover-bg-from: var(--color-blue-400);
    --button-hover-bg-to: var(--color-indigo-500);
    --button-hover-border: var(--color-indigo-700);
    --button-hover-text: var(--color-white);

    --button-active-bg-from: var(--color-rose-400);
    --button-active-bg-to: var(--color-red-500);
    --button-active-border: var(--color-red-700);

    --button-border-radius: 5px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: var(--color-neutral-800);
        --text-color: var(--color-gray-100);

        --button-bg: var(--color-neutral-600);
        --button-border: var(--color-neutral-900);
    }
}

:root {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    font-family: "Poppins-Regular";
    font-size: var(--font-size);
    color: var(--text-color);
    background-color: var(--background-color);

    transition: background-color 0.3s;
}

button {
    display: flex;
    align-items: center;
    justify-content: center;
    border-width: 5px;
    margin: 15px 0;

    width: 200px;
    max-width: 90%;
    height: 65px;

    @media (min-width: 600px) {
        width: 300px;
    }

    @media (min-width: 800px) and (min-height: 600px) {
        width: 400px;
        height: 80px;
    }

    /* In order to have linear-gradient to animate, it needs to have the same number of color stops */
    background: linear-gradient(var(--gradient-degree), var(--button-bg), 1%, var(--button-bg));
    border-color: var(--button-border);
    border-radius: var(--button-border-radius);

    transition: background 0.6s, scale 0.6s, border-radius 1.0s ease-in-out, border-color 0.4s, outline-color 0.4s, width 0.6s, height 0.6s;

    outline: initial;
    scale: 1.0;

    &:hover {
        background: linear-gradient(var(--gradient-degree), var(--button-hover-bg-from), var(--button-hover-bg-to));
        border-color: var(--button-hover-border);
    }

    &:active {
        background: linear-gradient(var(--gradient-degree), var(--button-active-bg-from), var(--button-active-bg-to));
        border-color: var(--button-active-border);
    }
    &:hover, &:active {
        scale: 1.05;
        color: var(--button-hover-text);
        border-radius: calc(var(--button-border-radius) + 5px);
    }

    &:focus-visible {
        outline: 3px red;
    }

    text {
        transition: color 0.4s;
    }
}

button.dark-light-button {
    position: absolute;
    top: 25px;
    right: 25px;
    margin: 0;

    width: 80px;
    height: 40px;

    font-size: calc(var(--font-size) * 0.6);
    border-width: 3px;

    &:hover, &:active {
        color: var(--text-color);
        background: linear-gradient(var(--button-bg), var(--button-bg));
        border-color: var(--button-border);
    }
}
