/********* vendor reset styles *********/
/* Box sizing rules and Inherit fonts */
*,
*::before,
*::after {
    font: inherit;
    box-sizing: border-box;
}

*:focus {
    outline: 1px dotted;
}

:root {
    --primary-color: #596dd4;
    --transition: 0.3s ease-in-out 0s;
}

/********* page styles *********/
html {
    font-display: swap;
    scroll-behavior: smooth;
    height: -webkit-fill-available;
    font-size: 62.5%;
}

html,
body {
    height: 100%;
}

img {
    max-width: 100%;
}

body {
    background-color: #f5f5f5;
    font: normal normal 1.6rem/2 Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;;
    display: grid;
    grid-template-columns: auto;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

header {
    padding: 3rem;
    background-color: var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-size: 3rem;
    font-weight: bold;
    margin: 0 auto;
    color: #fff;
}

.instructions {
    margin: 0;
    color: #000;
}

.instructions li span {
    display: flex;
    align-items: center;
}

.instructions li::marker {
    content: "›› ";
    margin: 0 0 0 1rem;
    color: #333;
}

.instructions li img {
    display: inline-block;
    margin: 0 0.5rem;
}

.input-form {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#add-item-form {
    padding: 3rem 8rem;
}

.input-form input {
    padding: 0 1.5rem;
    border: 1px solid #ddd;
    font-size: 1.6rem;
    height: 4rem;
    display: block;
}

.add-item-form__date-time {
    margin-right: -1px;
}

.add-item-form__text {
    flex-grow: 2;
}

.add-item-form__add-btn,
.add-item-form__save-btn {
    border: 0;
    display: block;
    width: 4rem;
    height: 4rem;
    cursor: pointer;
    background-color: #333;
}
.add-item-form__add-btn {
    -webkit-mask: url('./icons/add.svg') center / 100% no-repeat;
    mask: url('./icons/add.svg') center / 100% no-repeat;
}

.add-item-form__save-btn {
    -webkit-mask: url('./icons/save.svg') center / 100% no-repeat;
    mask: url('./icons/save.svg') center / 100% no-repeat;
}

.add-item-form__add-btn:hover,
.add-item-form__save-btn:hover {
    background-color: var(--primary-color);
}

#list {
    margin: 2rem 3rem;
    list-style: none;
    padding: 0;
}

.list__item {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 1px rgb(0 0 0 / 30%);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    background-color: rgba(255,255,255,0.6);
}

.list__item__delete-btn,
.list__item__edit-btn {
    flex: 0 1 auto;
    cursor: pointer;
    border: 2px solid #ddd;
    padding: 0.5rem;
    margin-right: 2rem;
    border-radius: 100%;
    background: transparent;
}

.list__item__delete-btn i,
.list__item__edit-btn i {
    background-color: #999;
    height: 2.4rem;
    width: 2.4rem;
    display: block;
}

.list__item__complete-btn {
    -webkit-mask: url('./icons/unchecked.svg') center / 100% no-repeat;
    mask: url('./icons/unchecked.svg') center / 100% no-repeat;
    margin-right: 2rem;
    background-color: #999;
    height: 3rem;
    width: 3rem;
    display: block;
    cursor: pointer;
}

.list__item__text {
    flex: 1 2 auto;
}
.list__item__time {
    flex: 0 1 auto;
    margin-right: 2rem;
}
.list__item__edit-btn i {
    -webkit-mask: url('./icons/edit.svg') center / 100% no-repeat;
    mask: url('./icons/edit.svg') center / 100% no-repeat;
}
.list__item__edit-btn:hover {
    border-color: var(--primary-color);
}
.list__item__edit-btn:hover i {
    background-color: var(--primary-color);
}

.list__item__delete-btn i {
    -webkit-mask: url('./icons/delete.svg') center / 100% no-repeat;
    mask: url('./icons/delete.svg') center / 100% no-repeat;
}
.list__item__delete-btn:hover {
    border-color: hsl(0deg 100% 35%);
}
.list__item__delete-btn:hover i {
    background-color: hsl(0deg 100% 35%);
}

/* completed state */
.is-complete .list__item__complete-btn {
    background-color: rgb(2, 129, 40);
    -webkit-mask-image: url('./icons/check.svg');
    mask-image: url('./icons/check.svg');
}
.is-complete .list__item__time,
.is-complete .list__item__text {
    text-decoration: line-through;
}

footer {
    text-align: center;
    background-color: #333;
    color: #ccc;
    font-size: 1.3rem;
    padding: 2rem;
}
