@font-face {
    font-family: 'the_quicklyregular';
    src: url('fonts/the_quickly-webfont.woff2') format('woff2'),
        url('fonts/the_quickly-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;

}

* {
    box-sizing: border-box;
    transition: all 0.3s ease-in-out;
}

:root {
    --border-radius: 0.5em;
    --color-primary: #537B64;
    --color-primary-light: color-mix(in srgb, var(--color-primary) 90%, white);
    --color-primary-dark: color-mix(in srgb, var(--color-primary) 90%, black);
    --color-secondary: #3e2823;
    --color-confetti: #FBE290;
    --color-interactive: hsl(38, 44%, 48%);
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    background: #D9CFC3 url("/images/background.png") top center repeat;
    background-size: 100%;
    font-family: "Indie Flower", cursive;
    font-weight: 400;
    font-style: normal;
    font-size: 1.4em;
    letter-spacing: 0.1em;
    min-height: 100vh;
}

button {
    cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    padding: 0;
    color: var(--color-secondary);
}

h1 {
    font-size: 4em;
    font-family: 'the_quicklyregular';
    text-align: center;
    margin-top: 0.7em;
    text-shadow:
        1px 1px 0 var(--color-secondary),
        -1px 1px 0 var(--color-secondary),
        -1px -1px 0 var(--color-secondary),
        1px -1px 0 var(--color-secondary);
}

h2 {
    font-size: 2em;
    text-shadow:
        0.4px 0.4px 0 var(--color-secondary),
        -0.4px 0.4px 0 var(--color-secondary),
        -0.4px -0.4px 0 var(--color-secondary),
        0.4px -0.4px 0 var(--color-secondary);
}

h3 {
    font-size: 1.5em;
    text-shadow:
        0.4px 0.4px 0 var(--color-secondary),
        -0.4px 0.4px 0 var(--color-secondary),
        -0.4px -0.4px 0 var(--color-secondary),
        0.4px -0.4px 0 var(--color-secondary);
}

header,
main {
    margin: auto;
    padding: 1em;
    max-width: 50em;
    width: 100%;
}

header {
    margin-bottom: 0.5em;
    padding: 1em 4em;
}

header p {
    font-size: 1.2em;
    text-align: center;
}

main {
    flex-grow: 1;
}

main .list>div {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: "image" "content" "options";
    border-radius: var(--border-radius);
    background: #FFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    padding: 1em;
    gap: 1em;
    margin-bottom: 0.5em;
}

@media screen and (min-width: 800px) {
    main .list>div {
        grid-template-columns: 30% 1fr;
        grid-template-areas: "image content" "image options";
    }
}

main .list>div img,
main .list>div .no-image {
    display: block;
    grid-area: image;
    width: 100%;
    aspect-ratio: 1/1;
    background: #D9CFC3;
    object-fit: cover;
    border-radius: var(--border-radius);
}

main .list>div a {
    color: var(--color-interactive);
    text-shadow:
        0.3px 0.3px 0 var(--color-interactive),
        -0.3px 0.3px 0 var(--color-interactive),
        -0.3px -0.3px 0 var(--color-interactive),
        0.3px -0.3px 0 var(--color-interactive);
}

main .list>div .options {
    padding-top: 1em;
    grid-area: options;
    text-align: right;
}

main .list>div .options button {
    display: inline-block;
    font-size: 1em;
    padding: 0.6em 1em 0.5em;
    background: var(--color-primary);
    color: #FFF;
    border-radius: var(--border-radius);
    border: none;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);

    font-family: "Indie Flower", cursive;
    letter-spacing: 0.1em;

    text-shadow:
        0.3px 0.3px 0 #FFF,
        -0.3px 0.3px 0 #FFF,
        -0.3px -0.3px 0 #FFF,
        0.3px -0.3px 0 #FFF,
        1px 2px 2px rgba(0, 0, 0, 0.34);
}

main .list>div .options button:hover {
    background: var(--color-primary-light);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

main .list>div .options button:active {
    background: var(--color-primary-dark);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12), inset 0 1px 2px rgba(0, 0, 0, 0.24);
}

main .list>div .options button:disabled {
    color: var(--color-primary-dark);
    background: #CCC;
    text-shadow: none;
    box-shadow: none;
    cursor: not-allowed;
}

main .list>div .content {
    grid-area: content;
}

footer {
    text-align: center;
    padding: 2em;
    font-size: 0.7em;
    letter-spacing: 0.1em;
}

footer a {
    color: var(--color-primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ------------------------------ */
.confetti-button {
    position: relative;
}

.confetti-button:before,
.confetti-button:after {
    position: absolute;
    content: '';
    display: block;
    width: 140%;
    height: 300%;
    left: -20%;
    transition: all ease-in-out 0.5s;
    background-repeat: no-repeat;
}

.confetti-button:before {
    display: none;
    top: -260%;
    left: -5%;
    background-image: radial-gradient(circle, var(--color-confetti) 20%, transparent 20%), radial-gradient(circle, transparent 20%, var(--color-confetti) 20%, transparent 30%), radial-gradient(circle, var(--color-confetti) 20%, transparent 20%), radial-gradient(circle, var(--color-confetti) 20%, transparent 20%), radial-gradient(circle, transparent 10%, var(--color-confetti) 15%, transparent 20%), radial-gradient(circle, var(--color-confetti) 20%, transparent 20%), radial-gradient(circle, var(--color-confetti) 20%, transparent 20%), radial-gradient(circle, var(--color-confetti) 20%, transparent 20%), radial-gradient(circle, var(--color-confetti) 20%, transparent 20%);
    background-size: 10% 10%, 20% 20%, 15% 15%, 20% 20%, 18% 18%, 10% 10%, 15% 15%, 10% 10%, 18% 18%;
}

.confetti-button:after {
    display: none;
    bottom: -300%;
    left: -17%;
    background-image: radial-gradient(circle, var(--color-confetti) 20%, transparent 20%), radial-gradient(circle, var(--color-confetti) 20%, transparent 20%), radial-gradient(circle, transparent 10%, var(--color-confetti) 15%, transparent 20%), radial-gradient(circle, var(--color-confetti) 20%, transparent 20%), radial-gradient(circle, var(--color-confetti) 20%, transparent 20%), radial-gradient(circle, var(--color-confetti) 20%, transparent 20%), radial-gradient(circle, var(--color-confetti) 20%, transparent 20%);
    background-size: 15% 15%, 20% 20%, 18% 18%, 20% 20%, 15% 15%, 10% 10%, 20% 20%;
}

.confetti-button.animate:before {
    display: block;
    background-position: 5% 90%, 10% 90%, 10% 90%, 15% 90%, 25% 90%, 25% 90%, 40% 90%, 55% 90%, 70% 90%;
    animation: topBubbles ease-out 0.75s forwards;
}

.confetti-button.animate:after {
    display: block;
    background-position: 10% -10%, 30% 10%, 55% -10%, 70% -10%, 85% -10%, 70% -10%, 70% 0%;
    animation: bottomBubbles ease-out 0.75s forwards;
}

@keyframes topBubbles {
    0% {
        background-position: 5% 90%, 10% 90%, 10% 90%, 15% 90%, 25% 90%, 25% 90%, 40% 90%, 55% 90%, 70% 90%;
    }

    50% {
        background-position: 0% 80%, 0% 20%, 10% 40%, 20% 0%, 30% 30%, 22% 50%, 50% 50%, 65% 20%, 90% 30%;
    }

    100% {
        background-position: 0% 70%, 0% 10%, 10% 30%, 20% -10%, 30% 20%, 22% 40%, 50% 40%, 65% 10%, 90% 20%;
        background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
}

@keyframes bottomBubbles {
    0% {
        background-position: 10% -10%, 30% 10%, 55% -10%, 70% -10%, 85% -10%, 70% -10%, 70% 0%;
    }

    50% {
        background-position: 0% 80%, 20% 80%, 45% 60%, 60% 100%, 75% 70%, 95% 60%, 105% 0%;
    }

    100% {
        background-position: 0% 90%, 20% 90%, 45% 70%, 60% 110%, 75% 80%, 95% 70%, 110% 10%;
        background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
}

/* ------------------------------ */

#thank-you {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
    padding: 0.5em;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    transform: translateY(-100%);
    text-align: center;
    width: 100%;
    transition: transform 0.3s ease-in-out;
}


#thank-you.open {
    transform: translateY(0);
}


#thank-you p {
    margin: 0;
}

#thank-you button {
    display: inline-block;
    font-size: 0.8em;
    padding: 0.2em 1em 0.1em;
    margin-top: 1em;
    background: var(--color-confetti);
    color: black;
    border-radius: var(--border-radius);
    border: none;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);

    font-family: "Indie Flower", cursive;
    letter-spacing: 0.1em;
}

#thank-you button:hover {
    background: var(--color-interactive);
}

#thank-you button:active {
    background: var(--color-confetti);
    box-shadow: none;
}

/* ------------------------------ */
#show-past-wishes {
    display: none;
    background: none;
    font-size: 1.2em;
    text-align: center;
    border: none;
    margin: auto;
    font-family: "Indie Flower", cursive;
    cursor: pointer;
}

#show-past-wishes:hover {
    text-decoration: underline;
}

#show-past-wishes.show {
    display: block;
}

#past-wishes {
    background: white;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
    padding: 0.5em;
    text-align: center;
    transform: translateY(100%);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    transition: transform 0.3s ease-in-out;
}

#past-wishes.open {
    transform: translateY(0);
}

#past-wishes .close {
    position: absolute;
    right: 0.5em;
    top: 0.5em;
    cursor: pointer;
}

#past-wishes ul {
    max-width: 25em;
    margin: auto;
    list-style: none;
    padding: 0;
    text-align: center;
}

#past-wishes ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #CCC;
    padding: 0.5em 0;
}

#past-wishes ul li:last-child {
    border-bottom: none;
}

#past-wishes ul li button {
    display: inline-block;
    font-size: 0.8em;
    padding: 0.2em 1em 0.1em;
    background: var(--color-primary);
    color: #FFF;
    border-radius: var(--border-radius);
    border: none;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);

    font-family: "Indie Flower", cursive;
    letter-spacing: 0.1em;
}

/* ------------------------------ */
#tracker > * {
    max-width: 600px;
}
#tracker header {
    margin: 0;
    margin: auto;
    padding: 0;
}

#tracker .forms button {
    display: block;
    width: 100%;
}
#tracker main .forms {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1em;
}

#tracker .manual-add {
    display: block;
    text-align: center;
    grid-column: span 2;
    color: var(--color-interactive);
    font-weight: 900;
    cursor: pointer;
}
#tracker .manual-add:hover,
#tracker .manual-add:focus,
#tracker .manual-add:active {
    text-decoration: underline;
}

#tracker .list {
    margin: 2em 0;
    line-height: 1.3em;
    text-align: center;
}
#tracker .feeding-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    gap: 20px;
    border-bottom: 1px solid var(--color-primary-light);
    cursor: pointer;
    position: relative;
}
#tracker .feeding-item:last-of-type {
    border-bottom: none;
}
#tracker .feeding-item:hover,
#tracker .feeding-item:focus,
#tracker .feeding-item:active {
    background: rgba(255, 255, 255, 0.3);
}
#tracker .feeding-item * {
    text-align: center;
}
#tracker .feeding-item span:last-of-type {
    padding-right: 24px;
}
#tracker .feeding-item .time {
    text-align: right;
}
#tracker .time-since {
    color: var(--color-primary);
    font-size: 0.7em !important;
}
#tracker .feeding-item .side {
    text-align: left;
}
#tracker .feeding-item button {
    position: absolute;
    right: 5px;
    top: 14px;
    font-size: 0.8em;
    color: #999;
    background: none;
    border: none;
    width: auto;
}
#tracker .last-feeding {
    text-align: center;
    line-height: 2.4em;
    margin: 2em 0;
}
#tracker .last-feeding span {
    font-size: 1.8em;
}

#tracker #manual-add-modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    max-width: 100%;
}
#tracker #manual-add-modal.show {
    display: block;
}
#tracker #manual-add-modal #manual-add-backdrop {
    background: rgba(0, 0, 0, 0.4);
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}

#tracker #manual-add-modal section {
    width: 80vw;
    max-width: 600px;
    margin: 10vh auto;
    padding: 2em;
    border-radius: var(--border-radius);
    background: #FFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    padding: 1em;
    margin-bottom: 0.5em;
    text-align: center;
}

#tracker #manual-add-modal section input:not([type="radio"]),
#tracker #manual-add-modal section .select-side {
    margin-top: 2em;
    width: 100%;
}


/* ------------------------------ */

form:not([class="simple"]) {
    width: 100%;
    margin: auto;
    padding: 2em;
    max-width: 50em;
    border-radius: var(--border-radius);
    background: #FFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    padding: 1em;
    margin-bottom: 0.5em;
    text-align: center;
}

input[type="submit"], button.submit {
    font-size: 1.2em;
    padding: 0.6em 1em 0.5em;
    background: var(--color-primary);
    color: #FFF;
    border-radius: var(--border-radius);
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    border: none;
    margin-top: 1em;
    font-family: "Indie Flower", cursive;
    letter-spacing: 0.1em;
    text-shadow:
        0.3px 0.3px 0 #FFF,
        -0.3px 0.3px 0 #FFF,
        -0.3px -0.3px 0 #FFF,
        0.3px -0.3px 0 #FFF,
        1px 2px 2px rgba(0, 0, 0, 0.34);
}

input[type="submit"]:hover, button.submit:hover {
    background: var(--color-primary-light);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

input[type="submit"]:active, button.submit:active {
    background: var(--color-primary-dark);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12), inset 0 1px 2px rgba(0, 0, 0, 0.24);
}

input[type="text"],
input[type="password"],
input[type="time"] {
    display: block;
    width: 100%;
    font-size: 1.2em;
    letter-spacing: 0.1em;
    padding: 0.6em 1em 0.5em;
    border-radius: var(--border-radius);
    text-decoration: none;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    border: none;
    border: 1px solid #CCC;
}

input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;

    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 0.15em solid currentColor;
    border-radius: 50%;
    transform: translateY(-0.075em);

    display: grid;
    place-content: center;
}


input[type="radio"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    border-radius: 50%;
    transform: scale(0);
    transition: 0.05s transform ease-in-out;
    box-shadow: inset 1em 1em var(--color-primary);
}

input[type="radio"]:checked::before {
  transform: scale(1);
}

input[type="radio"]:focus {
  outline: max(2px, 0.15em) solid currentColor;
  outline-offset: max(2px, 0.15em);
}

label.radio {
  line-height: 1.1;
  display: grid;
  grid-template-columns: 1em auto;
  gap: 0.5em;
  text-align: left;
}

label.radio + label.radio {
  margin-top: 1em;
}

label.radio:focus-within {
  color: var(--color-primary);
}

.error {
    color: red;
    text-align: center;
}
