body {
    font-family: cursive;
    background-image: url('./img/bg-to-do.png');
    background-size: cover;
    background-position: top left;
    background-repeat: repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    padding: 20px;
}

.todo-container {
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    width: 800px;
    min-height: 150px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1), inset 0 0 50px rgba(0, 0, 0, 0.2), 0 0 20px rgba(0, 0, 0, 0.3); 
    border: 2px solid #000000; 
    animation: fadeIn 0.6s ease-out;
}

h1 {
    text-align: center;
}

#todo-items {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
}

#todo-items input {
    width: 95%;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    color: #333;
    background-color: #f9f9f9;
    transition: all 0.3s ease; 
}

#todo-items input:focus {
    outline: none; 
    border-color: #000000; 
    background-color: #fff;
    box-shadow: 0 0 10px rgba(92, 184, 92, 0.3);
    transform: scale(1.05); 
}

#todo-items input::placeholder {
    color: #888; 
    font-style: italic; 
}

@keyframes inputFocus {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

#todo-items input:focus {
    animation: inputFocus 0.2s ease-out;
}


#new-task {
    width: 70%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#add-task-btn {
    padding: 8px 12px;
    background-color: transparent;
    border: 1px solid black;
    color: black;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease; 
}

#add-task-btn:hover {
    background-color: #000000;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

#add-task-btn {
    animation: fadeIn 0.6s ease-out;
}

#list {
    width: 83%;
    display: flex;
    flex-direction: column; 
    align-items: flex-start; 
    padding: 10px;
    margin-left: 50px;
    word-break: break-word; 
}

ul {
    list-style-type: none;
    padding: 0;
    margin-top: 10px;
    width: 100%;
}

li {
    display: flex;
    align-items: center; 
    justify-content: flex-start; 
    width: 100%;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    gap: 10px; 
}

button.delete-btn {
    background-color: #d9534f;
    color: white;
    border: none;
    padding: 5px 8px;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
}

.edit-btn{
    background-color: white;
    color: black;
    border: 1px solid black;
    padding: 5px 8px;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
}

.save-btn{
    background-color: #63bf3c;
    color: white;
    border: 1px solid black;
    padding: 5px 8px;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
}

button.delete-btn:hover {
    background-color: #c9302c;
}

.edit-btn:hover{
    background-color: black;
    color: white;
}

.save-btn:hover{
    background-color: #008000;
}

li.completed {
    text-decoration: line-through;
    color: #888;
}

#actions {
    text-align: center;
}

/* Buttons */

#actions button {
    padding: 8px 12px;
    margin: 5px;
    border: 1px solid black;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#print-btn {
    background-color: #008CBA;
    color: white;
}

#send-btn {
    background-color: #4CAF50;
    color: white;
}

#print-btn:hover {
    background-color: #0073a8;
    transform: scale(1.1); 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#send-btn:hover {
    background-color: #3a8e41;
    transform: scale(1.1); 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}


/* Media Queries for responsiveness */

/* For tablets (portrait) */
@media (max-width: 768px) {

    body{
        padding: 20px;
    }

    .todo-container {
        width: 100%;
    }

    #todo-items {
        flex-direction: column;
        align-items: stretch;
    }

    #new-task {
        width: 100%;
        margin-bottom: 10px;
    }

    #add-task-btn {
        width: 100%;
    }

    #list {
        width: 100%;
        margin-left: 0;
    }

    li {
        flex-direction: row; 
        align-items: center; 
        flex-wrap: wrap;
        gap: 10px;
    }    

    button.delete-btn, button.edit-btn {
        width: auto;
        padding: 5px 10px;
    }
}

/* For mobile devices */
@media (max-width: 480px) {
    .todo-container {
        width: 100%;
        padding: 15px;
    }

    #todo-items {
        flex-direction: column;
        align-items: stretch;
    }

    #new-task {
        width: 100%;
        margin-bottom: 10px;
    }

    #add-task-btn {
        width: 100%;
    }

    #list {
        width: 100%;
        margin-left: 0;
    }

    li {
        flex-direction: row; 
        align-items: center; 
        flex-wrap: wrap; 
        gap: 10px;
    }    

    button.delete-btn, button.edit-btn {
        width: auto;
        padding: 5px 10px;
    }
}
