@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

* {
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
  box-sizing: border-box;
}

body {
    background: #c3e0f5;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Ensures footer stays at the bottom */
}

.container {
    background: #F8FAFC;
    padding: 25px;
    width: 550px;
    max-width: 90%;
    border-radius: 10px;
    overflow: hidden; /* Ensures child elements do not overflow */
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

.todo-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
}

.todo-item {
    display: flex;
    align-items: center; /* Ensures vertical alignment */
    gap: 10px; /* Adds spacing between the checkmark and text */
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

.todo-item img {
    width: 20px; /* Adjust the icon size */
    height: 20px;
    cursor: pointer;
    object-fit: contain;
}

.todo-item span {
    font-size: 16px;
    line-height: 20px;
}


.todo-body {
    display: flex;
    align-items: center;
    background: #edeef0;
    border-radius: 30px;
    padding: 15px;
    margin-bottom: 10px;
    width: 100%;
    gap: 10px; /* Adds spacing without breaking layout */
}

.todo-body input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px;
    font-size: 18px;
    color: #333;
}

h5#Alert {
    text-align: center;
    color: green;
    margin-bottom: 10px;
    font-size: 14px;
}

.todo-body img {
    cursor: pointer;
    border-radius: 50%;
    height: 40px;
    width: 40px;
    padding: 10px;
    background: limegreen;
}

.list-items {
    width: 100%;
    padding: 0;
    margin: 0;
    list-style-type: none;
    overflow: hidden; /* Prevents horizontal overflow */
}

.list-items li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    width: 100%; /* Ensures list items stay inside */
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

h5 {
    text-align: center;
    margin-bottom: 10px;
    color: green;
}

.todo-controls {
    width: 20px; 
    height: 20px;
    cursor: pointer;
    margin: 0 5px; /* Adds spacing */
}

.todo-controls img {
    width: 20px;  /* Makes all icons smaller */
    height: 20px;
    object-fit: contain;
}

.check {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}
.clear-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    margin-bottom: 20px;
    border: none;
    background: red;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}

.clear-btn:hover {
    background: darkred;
}

/* Footer Styling */
footer {
    text-align: center;
    padding: 15px 0;
    font-size: 14px;
    color: #333;
    width: 100%;
    padding: 50px;
    padding-bottom: 3px;
    position: relative; 
}

.socials {
    margin-top: 5px;
}

.socials a {
    color: rgb(0, 0, 0);
    margin: 0 12px;
    font-size: 22px;
    text-decoration: none;
    transition: color 0.3s, transform 0.2s;
}

.socials a:hover {
    color: #4a64e8; /* Highlight effect */
    transform: scale(1.2); /* Slight zoom effect */
}

li {
    opacity: 0;
    animation: new-item-animation 0.3s linear forwards;
}

@keyframes new-item-animation {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

li.deleted-item {
    animation: removed-item-animation 0.5s ease-out forwards;
}

@keyframes removed-item-animation {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Mobile Devices */
@media (max-width: 600px) {
    body {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100vh;
        padding: 0;
        margin: 0;
    }

    .container {
        width: 95%;
        max-width: 400px; /* Keeps it at a readable size */
        margin: auto; /* Ensures it's centered */
        padding: 20px;
    }

    .todo-body {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .todo-body input {
        font-size: 18px;
        width: 80%; /* Avoid full width so it doesn’t touch edges */
    }

    .todo-controls {
        width: 30px;
        height: 30px;
    }

    footer {
        position: relative;
        bottom: 10px;
        text-align: center;
        width: 100%;
        padding: 20px;
        padding-bottom: 3px;
    }
}


/* Tablets */
@media (max-width: 1024px) {
    body {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100vh;
        margin: 0;
    }

    .container {
        width: 85%;
        max-width: 600px; /* Prevents it from stretching too much */
        margin: auto;
        padding: 25px;
    }

    .todo-body {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .todo-body input {
        font-size: 20px;
        width: 85%; /* Keeps it from touching edges */
    }

    .todo-controls {
        width: 28px;
        height: 28px;
    }

    footer {
        position: relative;
        bottom: 15px;
        text-align: center;
        width: 100%;
    }
}

