/* 🌟 General Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* 📝 Todo Container */
.todo-container {
    background: #fff;
    width: 90%;
    max-width: 500px;
    margin: 20px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-weight: 500;
}

/* 🎛️ Input Field */
.input-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

#todo-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1em;
    border: none;
    border-radius: 50px;
    outline: none;
    background: #f0f2f5;
    transition: background 0.3s ease;
}

#todo-input:focus {
    background: #e2e6ea;
}

#add-button {
    padding: 15px 20px;
    margin-left: 10px;
    font-size: 1.2em;
    color: #fff;
    background: #007bff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

#add-button i {
    pointer-events: none; /* Ensure the icon doesn't affect button clicks */
}

#add-button:hover {
    background: #0056b3;
    transform: scale(1.05);
}

/* 📋 Task List */
#todo-list {
    list-style: none;
    padding: 0;
}

.todo-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease;
}

.todo-text {
    flex: 1;
    font-size: 1em;
    color: #495057;
}

.todo-item.completed {
    background: #d4edda; /* Light green background for completed tasks */
}

.todo-text.completed {
    text-decoration: line-through;
    color: #155724;
}

/* 📅 Date and Time Styles */
.todo-datetime {
    display: block;
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 5px;
}

/* 🎨 Tick Icon Color Changes */
.action-btn.complete i {
    color: #6c757d; /* Initial gray color */
    transition: color 0.3s ease;
}

.action-btn.complete.completed-button i {
    color: #28a745; /* Green color when completed */
}

.todo-actions {
    display: flex;
    align-items: center;
}

.action-btn {
    background: none;
    border: none;
    padding: 0 8px;
    font-size: 1.2em;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.3s ease, transform 0.2s ease;
}

.action-btn i {
    pointer-events: none; /* Ensure the icon doesn't affect button clicks */
}

.action-btn:hover {
    transform: scale(1.2);
}

/* Delete Button Hover Effect */
.action-btn.delete:hover {
    color: #c82333;
}

/* Animations */
.todo-item.added {
    animation: slideIn 0.3s forwards;
}

.todo-item.removed {
    animation: slideOut 0.3s forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(50%);
    }
}

/* 📱 Responsive Design */
@media (max-width: 480px) {
    .todo-container {
        padding: 20px;
    }

    #todo-input {
        padding: 12px 15px;
        font-size: 0.9em;
    }

    #add-button {
        padding: 12px 15px;
        font-size: 1em;
    }

    .todo-item {
        padding: 12px 15px;
    }

    .todo-text {
        font-size: 0.9em;
    }

    .todo-datetime {
        font-size: 0.75em;
    }
}
