@import "reset.css";

:root {
    --main-fg-color: light-dark(#333, #ddd);
    --main-bg-color: light-dark(#ddd, #111);
    --alt-bg-color: light-dark(#ccc, #444);
    --neutral-color: light-dark(#888, #888);
}

html {
    color-scheme: light dark;
    color: var(--main-fg-color);
    background: var(--main-bg-color);
}

body {
    font-family: sans-serif;
    padding: 0.25rem 0.5rem;
}

table {
    border-collapse: collapse;
    margin: 0.5rem;
}

tr {
    border: 1px solid var(--alt-bg-color);
}

td {
    padding: 0.2rem 0.5rem;
    vertical-align: middle;
}

h1,
h2 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

h2 {
    color: var(--neutral-color);
}

p {
    margin: 0.5rem;
}

.event-list {
    max-width: 90%;

    td {
        vertical-align: middle;
        color: var(--neutral-color);
        max-width: 80ch;
        font-size: 0.9rem;
    }

    time {
        font-family: monospace;
        display: inline-block;
        height: 1.2em;
        line-height: 1em;
        font-size: 0.8rem;
    }
}

.login,
.task-add {
    input {
        border: 1px solid var(--neutral-color);
        padding: 0.2rem 0.2rem;
        border-radius: 0.3rem;

        &[type=text],
        &[type=password] {
            width: 20ch;
            text-align: center;
        }

        &[type=submit] {
            padding: 0.2rem 0.5rem;
            margin-left: 0.2rem;
            background: var(--alt-bg-color);
        }

        &:invalid {
            border-color: red;
        }

        &:placeholder-shown {
            border-color: var(--neutral-color);
        }

    }

    p.text {
        color: var(--neutral-color);
        margin-left: 0.5rem;
        margin-right: 0.5rem;
        font-size: 90%;
    }

    span.text {
        color: var(--neutral-color);
        margin-left: 0.2rem;
        margin-right: 0.2rem;
    }
}

div.task-list {
    display: flex;
    flex-wrap: wrap;
    margin-left: 0.5rem;


    .task {
        flex-grow: 0;
        flex-shrink: 0;
        width: 10rem;
        height: 12rem;
        border: 1px solid var(--neutral-color);
        border-radius: 0.7rem;
        display: flex;
        flex-direction: column;
        padding: 0.2rem 0 0;
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;

        background: linear-gradient(147deg, light-dark(#eee, #222) 0%, light-dark(#eee, #222) 30%, light-dark(#ddd, #333) 100%);
        background-size: 200% auto;

        &:nohover {
            background-position: right center;
        }

        &.due {
            .time {
                text-shadow: 0 0 3rem #c96100, 0 0 2rem #c96100, 0 0 1rem #c96100;
            }
        }

        &.started {
            background: linear-gradient(147deg, #0c4b03 0%, #0c4b03 20%, #062b01 100%);
            border: 1px solid #137c05;
            color: #eee;

            .actions {

                .start {
                    display: none;
                }

                .oops {
                    display: flex;
                }
            }
        }

        .task-label {
            font-weight: bold;
            font-size: 1.2rem;
            height: 2.4rem;
            text-align: center;
            flex-grow: 1;
            text-overflow: ellipsis;
            overflow: hidden;
            margin: 0 0.3rem;
        }

        .task-remove {
            flex-grow: 0;
            font-size: 0.8rem;
            font-weight: bold;
            text-align: right;
            color: var(--neutral-color);
            line-height: 1;
            margin: 0 0.3rem;

            input:hover {
                color: #a00;
            }
        }

        .time {
            text-align: center;
            height: 3rem;
            font-size: 3rem;
            flex-grow: 0;
            font-weight: bold;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .next {
            font-size: 0.7rem;
            text-align: center;
            flex-grow: 0;
            height: 1rem;
            color: var(--neutral-color);
            margin-bottom: 1rem;
        }

        .actions {
            display: flex;
            width: 100%;
            flex-grow: 0;
            justify-content: space-evenly;
            padding: 0 0.2rem;

            form {
                display: flex;
                flex-grow: 1;
            }

            .oops {
                display: none;
            }

            input[type=submit] {
                margin: 0.2rem 0;
                padding: 0.2rem 0;
                flex-grow: 1;
                text-align: center;
                transition: 0.3s;
                background-size: 200% auto;
                color: #ddd;
                border-radius: 0.5rem;
                border: 1px solid var(--neutral-color);
                font-weight: bold;
            }

            .start input,
            .oops input {
                background-image: linear-gradient(147deg, #6949f8 0%, #4139da 51%, #b700ff 100%);
                border-top-right-radius: 0;
                border-bottom-right-radius: 0;
                margin-right: 0;
            }

            .done input {
                background-image: linear-gradient(147deg, #2cc995 0%, #319968 51%, #9AE630 100%);
                border-top-left-radius: 0;
                border-bottom-left-radius: 0;
                margin-left: 0;
            }


            /* input {
                background-image: linear-gradient(to right, #7474BF 0%, #348AC7 51%, #7474BF 100%)
            } */

            input[type=submit]:hover {
                background-position: right center;
                color: #fff;
            }

        }
    }
}