* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    background: linear-gradient(
        90deg,
        rgba(116, 138, 237, 1) 0%,
        rgba(71, 104, 237, 1) 50%,
        rgba(53, 81, 240, 1) 100%
    );
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
    color: #333;
    transition: 0.3s ease;
}

h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

p {
    color: #e0e0e0;
    margin-bottom: 20px;
}

#theme-btn {
    margin-bottom: 15px;
    padding: 10px 18px;
    background: #222;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#search {
    width: 320px;
    padding: 10px 14px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: none;
    outline: none;
    font-size: 1rem;
}

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

.filters button {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    background: #2242e3;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.filters button:hover {
    background: #5f75e2;
}

#stats {
    margin-bottom: 20px;
    color: white;
    font-weight: bold;
}

#todo-input {
    width: 320px;
    padding: 10px 14px;
    margin: 20px 0;
    border-radius: 8px;
    border: none;
    outline: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#todo-input:focus,
#search:focus {
    transform: scale(1.02);
}

#add-btn {
    margin-left: 10px;
    padding: 10px 20px;
    background: #2242e3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#add-btn:hover {
    background: #5f75e2;
}

#todo-list {
    list-style: none;
    margin-top: 30px;
    width: 360px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    overflow: hidden;
}

#todo-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#todo-list li:hover {
    background: rgba(255,255,255,0.1);
}

#todo-list span {
    flex: 1;
    margin: 0 10px;
    cursor: pointer;
}

#todo-list input[type="checkbox"] {
    transform: scale(1.2);
}

#todo-list button {
    background: #e01414;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}

#todo-list button:hover {
    background: #e24f65;
}

#clear-completed {
    margin-top: 15px;
    padding: 10px 15px;
    background: #ff5252;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#clear-completed:hover {
    background: #ff7777;
}

.dark {
    background: #121212;
}

.dark h1,
.dark p,
.dark #stats {
    color: white;
}

.dark #todo-input,
.dark #search {
    background: #222;
    color: white;
}

.dark #todo-list {
    background: rgba(255,255,255,0.05);
}

.dark #theme-btn {
    background: white;
    color: black;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#todo-list li {
    animation: fadeIn 0.3s ease;
}

@media (max-width: 480px) {

    #todo-input,
    #search {
        width: 250px;
    }

    #todo-list {
        width: 300px;
    }

    .filters {
        flex-wrap: wrap;
        justify-content: center;
    }
}