:root {
    --bg-color: hsl(0, 0%, 98%);
    --text-color: hsl(235, 19%, 35%);
    --input-bg: hsl(0, 0%, 100%);
    --task-bg: hsl(0, 0%, 100%);
    --task-border: hsl(233, 11%, 84%);
    --accent-color: hsl(220, 98%, 61%);
    --checkbox-bg: hsl(233, 11%, 84%);
    --text-muted: hsl(236, 9%, 61%);
    --bg-image-mobile: url('assets/bg-mobile-light.jpg');
    --bg-image-desktop: url('assets/bg-desktop-light.jpg');
}

body.dark-mode {
    --bg-color: hsl(235, 21%, 11%);
    --text-color: hsl(234, 39%, 85%);
    --input-bg: hsl(235, 24%, 19%);
    --task-bg: hsl(235, 24%, 19%);
    --task-border: hsl(237, 14%, 26%);
    --checkbox-bg: hsl(237, 14%, 26%);
    --text-muted: hsl(236, 9%, 52%);
    --bg-image-mobile: url('assets/bg-mobile-dark.jpg');
    --bg-image-desktop: url('assets/bg-desktop-dark.jpg');
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Josefin Sans', sans-serif;
    background-color: var(--bg-color); 
    color: var(--text-color); 
    line-height: 1.5;
    min-height: 100vh;
}

button, input, textarea, select {
    font: inherit;
}

.todo {
    position: relative;
    max-width: 550px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.todo__background {
    height: 200px;
    width: 100%;
    z-index: -1;
    background-image: linear-gradient(225deg, rgba(85, 150, 255, 0.25), rgba(172, 45, 235, 0.25)), var(--bg-image-mobile);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top center;
    position: absolute;
    top: 0;
    left: 0;
}

.todo__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.todo__title {
    font-size: 20px;
    line-height: 1;
    letter-spacing: 0.5rem;
    text-transform: uppercase;
    font-weight: 700;
    color: white;
}

.todo__theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.todo__theme-toggle img {
    width: 20px;
    height: 20px;
    display: block;
}

.todo__form {
    background-color: var(--input-bg);
    border-radius: 5px;
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0px 35px 50px -15px rgba(194, 195, 214, 0.5);
}

.todo__circle {
    width: 20px;
    height: 20px;
    border: 1px solid var(--task-border);
    border-radius: 50%;
    display: inline-block;
    margin-right: 1rem;
}

.todo__input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 0.75rem;
    outline: none;
    line-height: 1.5;
    font-family: inherit;
}

.todo__input::placeholder {
    color: var(--text-color);
    opacity: 0.5;
}

.todo__container {
    background-color: var(--input-bg);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0px 10px 15px -5px rgba(0, 0, 0, 0.3), 0px 5px 5px -5px rgba(0, 0, 0, 0.2);
}

.todo__list {
    list-style: none;
}

.todo__item {
    width: 100%;
    min-height: 48px;
    background-color: var(--input-bg);
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--task-border);
    gap: 1rem;
}

.todo__check {
    width: 20px;
    height: 20px;
    border: 1px solid var(--task-border);
    border-radius: 50%;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}

.todo__text {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-color);
    line-height: 1.5;
}

.todo__delete {
    width: 1rem;
    height: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.todo__delete img {
    width: 0.8rem;
    height: 0.8rem;
}

.todo__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.todo__items-left {
    color: var(--text-muted);
}

.todo__clear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
}

.todo__clear:hover {
    color: var(--text-color);
}

.todo__filters-desktop,
.todo__filters-mobile {
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--input-bg);
}


.todo__filters-desktop {
    display: none;
}

.todo__filters-mobile {
    display: flex;
}

.todo__filters-mobile {
    margin-top: 1rem;
    border-radius: 5px;
    box-shadow: 0px 10px 15px -5px rgba(0, 0, 0, 0.3), 0px 5px 5px -5px rgba(0, 0, 0, 0.2);
}

.todo__filter {
    background: none;
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
}

.todo__filter:hover {
    color: var(--text-color);
}

.todo__filter--active {
    color: var(--accent-color);
    font-weight: 700;
}

.completed .todo__text {
    color: var(--text-muted);
    text-decoration: line-through;
}

.todo__check img {
    width: 0.75rem;
    height: 0.75rem;
}

.todo__check.checked {
    background: linear-gradient(to bottom right, hsl(192, 100%, 67%), hsl(280, 87%, 65%));
    display: flex;
    justify-content: center;
    align-items: center;
}

.todo__drag-info {
    color: var(--text-muted);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 400;
    margin-top: 2.5rem;
}

@media (min-width: 768px) {
    :root {
        font-size: 18px;
    }
    
    .todo__filters-desktop {
        display: flex;
    }

    .todo__filters-mobile {
        display: none;
    }
    .todo {
        max-width: 540px;
    }

    .todo__form,
    .todo__container,
    .todo__filters-mobile,
    .todo__filters-desktop {
        max-width: 100%;
    }

    .todo {
        padding: 3.75rem 0rem;
    }

    .todo__header {
        height: 48px;
        margin-bottom: 2.75rem;
    }

    .todo__title {
        font-size: 40px;
        line-height: normal;
        letter-spacing: 0.85rem;
    }

    .todo__theme-toggle img {
        width: 25px;
        height: 25px;
    }
    
    .todo__form {
        padding: 1.2rem;
        margin-bottom: 1.25rem;
    }

    .todo__input {
        font-size: 1rem;
        line-height: normal;
    }

    .todo__circle {
        width: 24px;
        height: 24px;
        margin-right: 1.25rem;
    }

    .todo__background {
        height: 300px;
        background-image: linear-gradient(225deg, rgba(85, 150, 255, 0.25), rgba(172, 45, 235, 0.25)), var(--bg-image-desktop);
    }

    .todo__item {
        gap: 1.25rem;
        padding: 1.2rem;
        height: auto;
    }

    .todo__text {
        font-size: 1rem;
        line-height: normal;
    }

    .todo__check {
        width: 24px;
        height: 24px;
    }

    .todo__check img {
        width: 0.6rem;
        height: 0.6rem;
    }

    .todo__footer {
        padding: 0 1.2rem;
    }

    .todo__drag-info {
        margin-top: 2.75rem;
    }
}