@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
    color: var(--primary-text);
}

button {
    cursor: pointer;
    transition: 0.2s ease;
}

button:hover {
    opacity: 0.8;
}

:root {
    --background: #f0f2f5;
    --container: #ffffff;
    --primary-text: #333333;
    --subtle-text: #777777;
    --action-buttons: #4a90e2;
    --action-buttons-hover: #357abd;
    --delete-button: #e74c3c;
    --completed-task-text: #3333337b;
    --shadow: rgba(0, 0, 0, 0.321);
    --filter-buttons-inactive: #dddddd;
    --filter-buttons-active: #4a90e2;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    background-color: var(--background);
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90vw;
    margin: 10px auto;
    background-color: rgb(119, 60, 178);
    box-shadow: 0px 0px 10px var(--shadow);
    padding: 3px;
    border-radius: 30px;
    flex-shrink: 0;
    /* do not shrink */
}

.navbar h1 {
    color: var(--background);
}

/* Input section */
.input-section {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 10px auto;
    flex-shrink: 0;
    /* do not shrink */
}

#user-input {
    background-color: var(--container);
    border: none;
    border-radius: 10px;
    outline: none;
    padding: 5px;
    font-size: 20px;
    width: 70%;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.178);
    color: var(--subtle-text);
}

.input-section button {
    background-color: var(--action-buttons);
    color: white;
    border-radius: 10px;
    padding: 5px;
    font-size: 20px;
    width: 140px;
    border: none;
    outline: none;
    margin: 0px 5px;
}

#cancel {
    background-color: var(--delete-button);
}

/* Container holds todo-section */
.container {
    width: 97vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 auto;
    /* take remaining space between header and footer */
    overflow: hidden;
    /* prevent whole page scroll */
}

/* Todo section scrollable only */
.todo-section {
    width: 100%;
    flex: 1;
    /* take remaining container space */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 10px;
    /* optional for spacing from footer */
}

/* Todo card */
.todo-card {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--action-buttons);
    border: none;
    outline: none;
    border-radius: 20px;
    cursor: pointer;
    background-color: #ffffff;
}

.todo {
    width: 70%;
    font-size: 20px;
    padding: 5px;
    border-radius: 10px;
    color: var(--primary-text);
    background-color: var(--container);
    margin: 0px 10px;
}

/* Buttons in todo card */
button {
    width: 80px;
    font-size: 15px;
    padding: 5px;
    border-radius: 10px;
    outline: none;
    border: none;
}

.delete {
    background-color: var(--delete-button);
    color: var(--background);
}

.edit {
    background-color: var(--action-buttons);
    color: var(--background);
}

/* Footer fixed at bottom */
.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: var(--filter-buttons-inactive);
    padding: 5px;
    text-align: center;
    box-shadow: 0px -2px 5px rgba(0, 0, 0, 0.2);
}





/* Media Queries for responsive layout */

/* Tablets / medium screens */
@media (max-width: 992px) {
    .navbar {
        width: 95vw;
        height: 40px;
    }

    .navbar h1{
        font-size: 20px;
    }

    #user-input {
        width: 65%;
        font-size: 18px;
    }

    .input-section button {
        width: 120px;
        font-size: 18px;
    }

    .todo {
        width: 75%;
        font-size: 18px;
    }

    button {
        width: 70px;
        font-size: 14px;
        padding: 4px;
    }


    .input-section {
        padding: 0px 10px;
    }
}

/* Small screens / mobiles */
@media (max-width: 768px) {
    .navbar {
        width: 98vw;
        font-size: 18px;
    }

    #user-input {
        width: 80%;
        font-size: 16px;
        padding: 4px;
    }

    .input-section button {
        width: 100px;
        font-size: 16px;
        padding: 4px;
    }

    .todo {
        width: 80%;
        font-size: 16px;
    }

    button {
        width: 70px;
        font-size: 13px;
        padding: 3px;
    }


    .input-section {
        padding: 0px 10px;
    }
}

/* Extra small screens / very small phones */
@media (max-width: 480px) {

    .navbar {
        width: 100vw;
        font-size: 16px;
        padding: 2px;
    }

    .input-section {
        padding: 0px 10px;
    }

    #user-input {
        width: 85%;
        font-size: 14px;
        padding: 3px;
    }

    .input-section button {
        width: 90px;
        font-size: 14px;
        padding: 3px;
    }

    .todo {
        width: 90%;
        font-size: 14px;
        padding: 3px;
    }

    button {
        width: 60px;
        font-size: 12px;
        padding: 2px;
    }

    .todo-section {
        gap: 8px;
        padding: 0px 15px;
    }
}