* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 480px;
    padding: 32px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 24px;
    text-align: center;
}

.todo-input {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.todo-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.todo-input input:focus {
    border-color: #667eea;
}

.todo-input button {
    padding: 12px 24px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.todo-input button:hover {
    background: #5a6fd6;
}

.todo-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-btn {
    flex: 1;
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

#todoList {
    list-style: none;
    margin-bottom: 16px;
    min-height: 200px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
    animation: slideIn 0.2s ease;
}

.todo-item:hover {
    border-color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.todo-item.completed {
    background: #f9f9f9;
    border-color: #e8e8e8;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #999;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #d0d0d0;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.todo-checkbox:checked {
    background: #667eea;
    border-color: #667eea;
    position: relative;
}

.todo-checkbox:checked::after {
    content: "✓";
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

.todo-text {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    word-break: break-word;
}

.delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #ccc;
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.delete-btn:hover {
    background: #fee;
    color: #e74c3c;
}

.todo-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 2px solid #f0f0f0;
}

#taskCount {
    font-size: 13px;
    color: #999;
}

#clearBtn {
    padding: 6px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

#clearBtn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.empty-tip {
    text-align: center;
    color: #ccc;
    font-size: 14px;
    padding: 48px 0;
}