* {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    transition: background 0.4s ease, color 0.4s ease;
}

.container {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #153677, #4e085f);
    padding: 10px;
}

.todo-app {
    width: 100%;
    max-width: 540px;
    background: #fff;
    margin: 100px auto 20px;
    padding: 40px 30px 70px;
    border-radius: 10px;
}

.todo-app h2 {
    color: #002765;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    justify-content: space-between;
}

.subtitle {
    color: #777;
    font-size: 14px;
    margin-top: -15px;
    margin-bottom: 20px;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #edeef0;
    border-radius: 30px;
    padding-left: 20px;
    margin-bottom: 25px;
}

input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px;
    font-weight: 14px;
}

button {
    border: none;
    outline: none;
    padding: 16px 50px;
    background: #ff5945;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    border-radius: 40px;
}

button:hover {
    background: #e04835;
}

ul li {
    list-style: none;
    font-size: 17px;
    padding: 12px 8px 12px 50px;
    user-select: none;
    cursor: pointer;
    position: relative;
}

ul li::before {
    content: '';
    position: absolute;
    height: 28px;
    width: 28px;
    border-radius: 50%;
    background-image: url(images/unchecked.png);
    background-size: cover;
    background-position: center;
    top: 12px;
    left: 8px;
}

ul li.checked {
    color: #555;
    text-decoration: line-through;
}

ul li.checked::before {
    background-image: url(images/checked.png);
}

ul li span {
    position: absolute;
    right: 0;
    top: 5px;
    width: 40px;
    height: 40px;
    font-size: 22px;
    color: #555;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
}

ul li span:hover {
    background: #edeef0;
}

.edit-btn {
    position: absolute;
    right: 45px;
    /* Slightly left from delete button */
    top: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: 0.2s ease;
}

/* Same hover effect as delete */
.edit-btn:hover {
    background: #edeef0;
}

.theme-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    background: #edeef0;
    transform: scale(1.08);
}

body.dark .theme-btn:hover {
    background: #3a3a3a;
}

/* DARK MODE */
body.dark {
    background: linear-gradient(135deg, #1f1f1f, #121212);
}

body.dark .todo-app {
    background: #2a2a2a;
    color: #fff;
}

body.dark input {
    color: #fff;
}

body.dark .row {
    background: #3a3a3a;
}

body.dark ul li {
    color: #ddd;
}

body.dark ul li.checked {
    color: #888;
}

.title-left {
    display: flex;
    align-items: center;
}

body.dark .todo-app h2 {
    color: #ffffff;
}


.main-icon {
    width: 30px;
    margin-left: 10px;
}

.task-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 15px;
    color: #555;
}

/* Dark mode support */
body.dark .task-stats {
    color: #ccc;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    background: #edeef0;
    font-size: 13px;
    transition: 0.2s ease;
    color: #000;
}

.filter-btn:hover {
    background: #d5d7db;
}

.filter-btn.active {
    background: #ff5945;
    color: #fff;
}

body.dark .filter-btn {
    background: #3a3a3a;
    color: #ccc;
}

body.dark .filter-btn.active {
    background: #ff5945;
    color: #fff;
}

.delete-all-btn {
    display: block;
    margin: 10px auto 15px;
    padding: 8px 18px;
    border: none;
    border-radius: 25px;
    background: #ff5945;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s ease;
    display: none;
}

.delete-all-btn:hover {
    background: #e04835;
}

body.dark .delete-all-btn {
    background: #ff5945;
    color: #fff;
}

.undo-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    z-index: 1000;
}

.undo-bar button {
    background: transparent;
    border: none;
    color: #ff5945;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}

#undo-btn {
    color: #ff5945;
}

#cancel-btn {
    color: #ccc;
}

#cancel-btn:hover {
    color: #fff;
}

.undo-bar button:hover {
    text-decoration: underline;
}

.time-info {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 5px;
}

body.dark .time-info {
    color: #aaa;
}

.progress-container {
    margin-bottom: 20px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 6px;
    color: #555;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #edeef0;
    border-radius: 20px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff5945, #ff8c42);
    border-radius: 20px;
    transition: width 0.4s ease-in-out;
}

/* Dark Mode */
body.dark .progress-text {
    color: #ccc;
}

body.dark .progress-bar {
    background: #3a3a3a;
}

#progress-section {
    display: none;
}