/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

/* ===== Body ===== */
body {
    background: linear-gradient(to right, #667eea, #764ba2);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.6s ease;
}

/* ===== Container ===== */
.todo-container {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ===== Heading ===== */
.todo-container h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

/* ===== Dark Mode Toggle Button ===== */
.theme-toggle {
    width: 100%;
    margin-bottom: 15px;
    padding: 8px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    background: #111827;
    color: white;
    font-size: 14px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.03);
}

/* ===== Input Box ===== */
.input-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-box input {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    transition: background-color 0.4s ease, color 0.4s ease, border 0.4s ease;
}

.input-box button {
    padding: 10px 15px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    background-color: #667eea;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.input-box button:hover {
    background-color: #5a67d8;
}

/* ===== Filters ===== */
.filters {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.filters button {
    flex: 1;
    margin: 0 5px;
    padding: 6px;
    font-size: 14px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    background: #e5e7eb;
}

.filters button.active {
    background: #667eea;
    color: white;
}

/* ===== Stats ===== */
.todo-stats {
    display: flex;
    justify-content: space-between;
    margin: 10px 0 15px;
    font-size: 14px;
    color: #374151;
}

/* ===== Clear Button ===== */
.clear-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 5px;
    background: #ef4444;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.clear-btn:hover {
    background: #dc2626;
}

/* ===== Task List ===== */
#taskList {
    list-style: none;
}

#taskList li {
    background: #f4f6f8;
    padding: 10px 12px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    animation: fadeIn 0.3s ease-in;
    transition: background-color 0.4s ease, color 0.4s ease, transform 0.2s ease;
}

#taskList li:hover {
    transform: scale(1.01);
}

#taskList li.completed {
    text-decoration: line-through;
    color: gray;
    background: #d1fae5;
}

/* ===== Delete Button ===== */
.delete-btn {
    background: #ef4444;
    border: none;
    color: white;
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== DARK MODE ===== */
body.dark {
    background: linear-gradient(to right, #0f172a, #020617);
}

body.dark .todo-container {
    background: #020617;
    color: #e5e7eb;
}

body.dark h1 {
    color: #e5e7eb;
}

body.dark input {
    background: #020617;
    color: white;
    border: 1px solid #334155;
}

body.dark #taskList li {
    background: #020617;
    color: #e5e7eb;
    border: 1px solid #334155;
}

body.dark #taskList li.completed {
    background: #064e3b;
    color: #a7f3d0;
}

body.dark .todo-stats {
    color: #e5e7eb;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .todo-container {
        margin: 0 15px;
    }
}
