@font-face {
    font-family: 'Outfit';
    src: url('./Outfit.woff2') format('woff2');
}

:root {
    --bg-color: hsl(0, 0%, 95%);
    --fg-color: hsl(0, 0%, 10%);
    --pause-color: hsl(0, 0%, 85%);
    --alert-bg: hsl(0, 68%, 42%);
    --running-bg: greenyellow;
    --alert-color: hsl(0, 68%, 52%);
    --remove-fg: hsl(16, 100%, 50%);
    --remove-icon-color: hsl(16, 100%, 80%);
    --settings-fg: red;
    --button-bg: hsl(217, 87%, 50%);
    --button-bg-hover: hsl(217, 87%, 30%);
    --button-fg: white;
    --input-border-color: hsl(0, 0%, 20%);
    --text-button-fg: hsl(217, 87%, 50%);
    --separation-border-color: rgba(255, 255, 255, 0.8);
    --finished-blink-bg: white;
    --play-icon-color: hsl(217, 87%, 80%);
    --input-bg: white;
    --border-inactive: hsl(0, 0%, 90%);
    --border-hover: hsl(0, 0%, 60%);
    --border-active: hsl(0, 0%, 40%);
    --timer-pause-color: var(--pause-color);
    --timer-icon-play: url('data:image/svg+xml,\
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="-0.5 0 7 7"><g transform="translate(-347.000000, -3766.000000)" fill="black"><g transform="translate(56.000000, 160.000000)"><path d="M296.494737,3608.57322 L292.500752,3606.14219 C291.83208,3605.73542 291,3606.25002 291,3607.06891 L291,3611.93095 C291,3612.7509 291.83208,3613.26444 292.500752,3612.85767 L296.494737,3610.42771 C297.168421,3610.01774 297.168421,3608.98319 296.494737,3608.57322"></path></g></g></svg>');
    --timer-icon-pause: url('data:image/svg+xml,\
<svg viewBox="-1 0 8 8" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-227.000000, -3765.000000)" fill="black"><g transform="translate(56.000000, 160.000000)"><path d="M172,3605 C171.448,3605 171,3605.448 171,3606 L171,3612 C171,3612.552 171.448,3613 172,3613 C172.552,3613 173,3612.552 173,3612 L173,3606 C173,3605.448 172.552,3605 172,3605 M177,3606 L177,3612 C177,3612.552 176.552,3613 176,3613 C175.448,3613 175,3612.552 175,3612 L175,3606 C175,3605.448 175.448,3605 176,3605 C176.552,3605 177,3605.448 177,3606"></path></g></g></svg>');
    --timer-icon-reset: url('data:image/svg+xml, <svg viewBox="0 0 16.399999 19.400002" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m 1.2000001,11.2 c 0,3.866 3.13401,7 7,7 C 12.066,18.2 15.2,15.066 15.2,11.2 c 0,-3.86599 -3.134,-7 -6.9999999,-7 h -5 m 0,0 3,-3 m -3,3 3,3" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="stroke-width:2.4;stroke-dasharray:none" /></svg>');
    --timer-icon-remove: url('data:image/svg+xml, <svg fill="black" viewBox="-3.5 0 19 19" xmlns="http://www.w3.org/2000/svg"><path d="M11.383 13.644A1.03 1.03 0 0 1 9.928 15.1L6 11.172 2.072 15.1a1.03 1.03 0 1 1-1.455-1.456l3.928-3.928L.617 5.79a1.03 1.03 0 1 1 1.455-1.456L6 8.261l3.928-3.928a1.03 1.03 0 0 1 1.455 1.456L7.455 9.716z"/></svg>');
    /* non-theme related */
    --transition-time-short: 0.12s;
    --transition-time-long: 0.19s;
    --transition-time-xlong: 1s;
    --opacity-dimmed: 0.6;
}
:root[data-theme='dark'] {
    --bg-color: hsl(60, 70%, 0%);
    --fg-color: hsl(10, 10%, 90%);
    --pause-color: hsl(0, 0%, 15%);
    --alert-bg: hsl(0, 68%, 42%);
    --running-bg: greenyellow;
    --alert-color: hsl(0, 68%, 42%);
    --remove-fg: hsl(16, 100%, 50%);
    --remove-icon-color: hsl(16, 100%, 70%);
    --settings-fg: greenyellow;
    --button-bg: hsl(84, 100%, 59%);
    --button-bg-hover: hsl(84, 100%, 39%);
    --button-fg: black;
    --input-border-color: hsl(0, 0, 80%);
    --text-button-fg: greenyellow;
    --separation-border-color: rgba(255, 255, 255, 0.2);
    --finished-blink-bg: var(--alert-bg);
    --play-icon-color: hsl(217, 87%, 80%);
    --input-bg: white;
    --border-inactive: hsl(0, 0%, 30%);
    --border-hover: hsl(0, 0%, 40%);
    --border-active: hsl(0, 0%, 60%);
    --timer-pause-color: var(--pause-color);
    --timer-icon-play: url('data:image/svg+xml,\
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="-0.5 0 7 7"><g transform="translate(-347.000000, -3766.000000)" fill="greenyellow"><g transform="translate(56.000000, 160.000000)"><path d="M296.494737,3608.57322 L292.500752,3606.14219 C291.83208,3605.73542 291,3606.25002 291,3607.06891 L291,3611.93095 C291,3612.7509 291.83208,3613.26444 292.500752,3612.85767 L296.494737,3610.42771 C297.168421,3610.01774 297.168421,3608.98319 296.494737,3608.57322"></path></g></g></svg>');
    --timer-icon-pause: url('data:image/svg+xml,\
<svg viewBox="-1 0 8 8" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-227.000000, -3765.000000)" fill="orange"><g transform="translate(56.000000, 160.000000)"><path d="M172,3605 C171.448,3605 171,3605.448 171,3606 L171,3612 C171,3612.552 171.448,3613 172,3613 C172.552,3613 173,3612.552 173,3612 L173,3606 C173,3605.448 172.552,3605 172,3605 M177,3606 L177,3612 C177,3612.552 176.552,3613 176,3613 C175.448,3613 175,3612.552 175,3612 L175,3606 C175,3605.448 175.448,3605 176,3605 C176.552,3605 177,3605.448 177,3606"></path></g></g></svg>');
    --timer-icon-reset: url('data:image/svg+xml, <svg viewBox="0 0 16.399999 19.400002" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m 1.2000001,11.2 c 0,3.866 3.13401,7 7,7 C 12.066,18.2 15.2,15.066 15.2,11.2 c 0,-3.86599 -3.134,-7 -6.9999999,-7 h -5 m 0,0 3,-3 m -3,3 3,3" stroke="lightblue" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="stroke-width:2.4;stroke-dasharray:none" /></svg>');
    --timer-icon-remove: url('data:image/svg+xml, <svg fill="red" viewBox="-3.5 0 19 19" xmlns="http://www.w3.org/2000/svg" class="cf-icon-svg"><path d="M11.383 13.644A1.03 1.03 0 0 1 9.928 15.1L6 11.172 2.072 15.1a1.03 1.03 0 1 1-1.455-1.456l3.928-3.928L.617 5.79a1.03 1.03 0 1 1 1.455-1.456L6 8.261l3.928-3.928a1.03 1.03 0 0 1 1.455 1.456L7.455 9.716z"/></svg>');
}

* {
    box-sizing: border-box;
}
html,
body {
    padding: 0;
    margin: 0;
    height: 100%;
}
html {
    background: var(--bg-color);
    color: var(--fg-color);
    font-size: 14px;
}
body {
    min-width: calc(320px + 1rem);
    overflow-y: scroll;
}
.form-name {
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.2em;
}
#statusbar {
    height: 0.5rem;
    position: fixed;
    width: 100vw;
    display: block;
    z-index: 2;
    top: 0;
    animation: blink-statusbar-default 3s infinite;
}

.statusbar-default {
    background-color: var(--bg-color);
}
.statusbar-pause {
    background-color: var(--pause-color);
}
.statusbar-running {
    background-color: var(--running-bg);
}
.statusbar-alert {
    background-color: var(--alert-bg);
    animation: blink-statusbar 1.5s infinite;
}
@keyframes blink-statusbar-default {
    0% {
        opacity: 1;
    }
    50% {
        opacity: var(--opacity-dimmed);
    }
    100% {
        opacity: 1;
    }
}
@keyframes blink-statusbar {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: var(--alert-bg);
    }
    100% {
        background-color: transparent;
    }
}

#timer_new_btn:after {
    color: var(--timer-border-fg);
}
#timer_new_quick {
    display: block;
}
#timer_new_quick::before {
    /*★ ☆ */
    content: '⚡';
    color: var(--play-icon-color);
    background-image: var(--timer-icon-play);
    display: block;
    float: left;
    width: 1em;
    height: auto;
}
#settings_form {
    padding-right: 0.6rem;
    border-width: 0 2px 0 0;
    border-color: var(--settings-fg);
    .form-name {
        color: var(--fg-color);
    }
}
.timer-name {
    margin: 0;
    padding: 0;
    font-weight: 800;
}
body,
input,
textarea,
button,
select {
    font-family: 'Outfit', sans-serif;
}
button,
a.btn,
input[type='submit'] {
    cursor: pointer;
    background: var(--button-bg);
    color: var(--button-fg);
    font-weight: bold;
    transition: background-color var(--transition-time-short) ease-in-out;
}
button:hover,
a.btn:hover,
input[type='submit']:hover {
    background-color: var(--button-bg-hover);
}
label {
    cursor: pointer;
}
/* --------------------------- FORM & INPUT */
input[type='text'],
textarea,
input[type='number'],
input[type='submit'],
button,
.btn,
select {
    padding: 0.4rem 0.6rem;
    margin: 0.3rem 0;
    border-radius: 0.4rem;
    display: block;
    border: 1px solid var(--input-border-color);
}
.top-buttons button {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
select {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}
select,
input[type='text'],
textarea,
input[type='number'] {
    width: 100%;
    display: block;
    background-color: var(--input-bg);
    color: #222;
}

@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }
}
input[type='text'],
textarea,
input[type='number'],
label {
    font-size: 0.9rem;
}
textarea {
    height: 5em;
}
form {
    height: 0;
    opacity: 0;
    visibility: hidden;
    transition-delay: 0.02s;
    transition-timing-function: ease;
    transition-duration: 0.3s;
    transition-property: opacity;
}

/* --------------------------- form class definitions */

.form-inputs-wrapper {
    display: flex;
    justify-content: space-between;
    margin-top: -0.3rem;
    margin-bottom: -0.3rem;
}
#new_timer_interval,
#settings_form_quickTimerInterval {
    max-width: 40%;
}
#new_timer_intervalUnit,
#settings_form_intervalUnit {
    max-width: calc(60% - 0.3rem);
}

form.dblock {
    visibility: visible;
    opacity: 1;
    height: 100%;
}
/* --------------------------- / FORM & INPUT */
a,
button.text-btn,/* TODO still relevant? */
.btn.text-btn, /* TODO still relevant? */
button.icon {
    color: var(--text-button-fg);
    background: transparent;
    border: 0;
}
button.text-btn,/* TODO still relevant? */
.btn.text-btn {
    display: inline-block;
}
button {
    &.text-btn:after {
        /* TODO still relevant? */
        font-size: 0.8em;
    }
    &.text-btn.expanded::after,
    &.text-btn.collapsed::after,
    &.text-btn.expanded2::before,
    &.text-btn.collapsed2::before {
        font-size: 0.7em;
        display: inline-block;
    }
    &.text-btn.collapsed::after,
    &.text-btn.collapsed2::before {
        content: '  ▲';
        color: var(--play-icon-color);
    }
    &.text-btn.expanded::after,
    &.text-btn.expanded2::before {
        content: '▼  ';
        color: var(--play-icon-color);
    }
    &.text-btn.expanded:after,
    &.text-btn.collapsed:after {
        margin-left: 0.7em;
    }
    &.text-btn.collapsed2:before,
    &.text-btn.expanded2:before {
        margin-right: 0.7em;
    }
}

/* --------------------------- general class definitions */
#wrapper {
    max-width: 320px;
    min-width: 300px;
    padding: 0.5rem;
    margin: 0 auto;
    position: relative;
}
.submit-buttons {
    justify-content: flex-start;
    align-items: center;
}
.submit-buttons .feedback {
    margin-left: 0.5em;
    opacity: 0;
    animation: feedbackfade var(--transition-time-xlong);
    font-size: 0.9em;
}
@keyframes feedbackfade {
    0% {
        opacity: 0%;
    }
    5% {
        opacity: 100%;
    }
    95% {
        opacity: 100%;
    }
    100% {
        opacity: 0;
    }
}

#timer_container {
    padding-top: 1rem;
}
.start_end_time_actions_wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.timer {
    padding: 1rem;
    margin: 0 -1rem 0;
    border-bottom: 1px dashed var(--separation-border-color);
    opacity: 1;

    button {
        margin-bottom: 0;
    }
    .buttons {
        justify-items: right;
        justify-content: flex-start;
        .control-btn {
            padding: 0;
            margin-left: 0;
            transition: opacity var(--transition-time-short) ease-in-out,
                background-size var(--transition-time-long) ease-in-out;
            font-size: 2em;
            width: 2em;
            height: 2em;
            border-radius: 50%;
            &:hover {
                opacity: 1;
            }
            span {
                display: none;
            }
        }
    }
    &.paused {
        background-color: var(--timer-pause-color);
        .timer-descr,
        .timer-countdown-current,
        .starttime_endtime_wrapper {
            opacity: var(--opacity-dimmed);
        }
    }
}
.timer.finished {
    animation: blink-finished 1.5s infinite;
}
.timer.finished .buttons .control-btn.pause {
    display: none;
}
@keyframes blink-finished {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: var(--finished-blink-bg);
    }
    100% {
        background-color: transparent;
    }
}
.buttons .text-btn,
.buttons .control-btn {
    text-decoration: none;
}
.timer .buttons .control-btn,
#audio_container .text-btn {
    display: flex;
    align-items: center;
    /* gap: 0.3rem; */
}
.timer .buttons button.control-btn {
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    display: flex;
    height: 2em;
    width: 2em;
    font-size: 1rem;
    font-weight: bold;
    margin: 0;
    border: 0;
    opacity: 0.7;
    /* filter: brightness(70%); */
    transition: opacity var(--transition-time-short) ease-in-out;
    filter: brightness(1) grayscale(100%);
    &:hover {
        filter: none;
        opacity: 1;
        background-color: var(--pause-color);
    }

    &.resume {
        background-image: var(--timer-icon-play);
        background-size: 0.8em auto;
        background-position: 55% 55%;
    }
    &.pause {
        background-image: var(--timer-icon-pause);
        background-size: 0.8em auto;
        background-position: 53.9% 55%;
    }
    &.reset {
        background-image: var(--timer-icon-reset);
        background-size: 0.85em auto;
    }
    &.remove {
        background-image: var(--timer-icon-remove);
        filter: invert(100%) saturate(0);
        background-size: 1.35em auto;
        background-position: 63% 50% !important;
        &:hover {
            filter: none;
        }
    }
}
[data-theme='light'] .timer .buttons button.control-btn {
    &.remove {
        filter: none;
    }
}

.timer.paused .buttons button.control-btn {
    &:hover {
        background-color: var(--bg-color);
    }
}

#timer_new_form .form-name {
    color: var(--fg-color);
}
#audio_container {
    float: left;
    width: 49%;
    padding-top: 1rem;
    .text-btn {
        padding-left: 2rem;
        color: var(--fg-color);
        padding: 0 0 0 1rem;
        margin: 0;
        background-size: 0.5em;
        background-position: 0 50%;
        background-repeat: no-repeat;
        background-color: transparent;

        &.play {
            color: var(--text-button-fg);
            background-image: var(--timer-icon-play);
        }
        &.pause {
            color: var(--remove-fg);
            background-image: var(--timer-icon-pause);
        }
    }
}
.buttons {
    display: flex;
}
.top-buttons {
    justify-content: right;
    .text-btn {
        color: var(--settings-fg);
        opacity: var(--opacity-dimmed);
        transition: opacity var(--transition-time-short),width var(--transition-time-long);
		justify-content: right;
        span {
            width: 0;
			white-space:nowrap;
            display:inline-flex;
            overflow: hidden;
            transition: width var(--transition-time-long) linear,overflow var(--transition-time-long);
			&::after{
				content:" "
			}
        }
        &:hover,
        &.expanded {
            opacity: 1;
            span {
                width: 5rem;
            }
        }
    }
}
.white,
a.white,
button.text-btn.white,
.btn.text-btn.white {
    color: var(--fg-color);
}
.statusbar-alert + #wrapper .text-btn.remove {
    color: var(--fg-color);
}
#clean_btn {
    display: none;
}
.timer-countdown-current,
.timer-countdown-total {
    display: inline-block;
}
#current_time,
#current_date {
    text-align: right;
}
#current_time {
    padding-top: 1rem;
}
#current_date {
    padding-bottom: 1rem;
}
/* miniclasses */
.dnone,
button.control-btn.dnone,
.control-btn.dnone, /* TODO redundant? */
#audio_container .text-btn.dnone {
    display: none;
}
.dimmed {
    opacity: var(--opacity-dimmed);
    &:hover {
        opacity: 1;
    }
}

.shown {
    opacity: 1;
    height: auto;
    overflow: auto;
}
.hidden {
    opacity: 0;
    height: 0;
    overflow: hidden;
}
